using C4IT.FASD.Base; using C4IT.MultiLanguage; using FasdDesktopUi.Basics; using FasdDesktopUi.Basics.Models; using FasdDesktopUi.Basics.Services.SupportCase.Controllers; using FasdDesktopUi.Basics.UiActions; namespace F4SD.Cockpit.Client.Test.Basics.Sevices.SupportCase.Controllers; public class MenuDataFactoryTest { public MenuDataFactoryTest() { cMultiLanguageSupport.CurrentLanguage = "EN"; } [Fact] public async Task Create_From_QuickActionDefinition() { cF4sdQuickActionRemoteComputer menuDataDefinition = new() { Id = Guid.NewGuid(), Names = new() { ["EN"] = "Foo EN", ["DE"] = "Foo DE" }, Icon = { IconType = enumIconType.intern, Name = nameof(enumInternIcon.misc_computer) }, Descriptions = new() { ["EN"] = "Bar EN", ["DE"] = "Bar DE" }, AlternativeDescriptions = new() { ["EN"] = "FooBar EN", ["DE"] = "FooBar DE" }, Section = "Section 1", Sections = ["Section 2", "Section 3"], IsHidden = false }; cMenuDataBase expected = new() { MenuText = "Foo EN", MenuIcon = new cMenuDataBase.MenuIconInfo(new(F4SD_AdaptableIcon.Enums.enumInternIcons.misc_computer), null, false, null), MenuSections = ["Section 1", "Section 2", "Section 3"], UiAction = new cUiRemoteQuickAction(menuDataDefinition) { DisplayType = FasdDesktopUi.Basics.Enums.enumActionDisplayType.enabled } }; cMenuDataBase actual = MenuDataFactory.Create(menuDataDefinition, [], []); Assert.Equivalent(expected, actual); } }