public AssemblyControllerTest() { mockAssemblyService = new MockAssemblyService(); ILogger <AssemblyController> mockLogger = MockLogger <AssemblyController> .CreateMockLogger(); assemblyController = new AssemblyController(mockAssemblyService, mockLogger); }
public async Task GetAssembliesNormalTest() { // Arrange var assemblyController = new AssemblyController(); // Act var result = await assemblyController.Get(); // Assert Assert.True(result.Success); Assert.NotNull(result.Data); }
static APIContext() { Assemblies = new AssemblyController(); Options = new OptionController(); Components = new ComponentController(); CPUs = new ReadOnlyBaseComponentController <ComponentCPU>("cpu"); RAMs = new ReadOnlyBaseComponentController <ComponentRAM>("ram"); GPUs = new ReadOnlyBaseComponentController <ComponentGPU>("gpu"); HDDs = new ReadOnlyBaseComponentController <ComponentHDD>("hdd"); SSDs = new ReadOnlyBaseComponentController <ComponentSSD>("ssd"); PowerUnits = new ReadOnlyBaseComponentController <ComponentPowerUnit>("powerunit"); Motherboards = new ReadOnlyBaseComponentController <ComponentMotherboard>("motherboard"); }
public async Task PutAssemblyComponentNormalTest() { // Arrange var component = MapUpdateAssemblyComponentVM(GetAssemblyComponent()); var assemblyController = new AssemblyController(); // Act var result = await assemblyController.Put(component); // Assert Assert.True(result.Success); Assert.NotNull(result.Data); }
public void CreateAssemblyTest() { if (AssemblyController <object> .CreateAssembly(@"..\..\..\Debug\StartUps\DefaultStartUp.dll") == null) { Assert.Fail(); } if (AssemblyController <object> .CreateAssembly(@"C:\Windows\system32\user32.dll") != null) { Assert.Fail(); } if (AssemblyController <object> .CreateAssembly(@"FileNotExists.dll") != null) { Assert.Fail(); } }
public async Task PostAssemblyNormalTest() { // Arrange var assembly = GetAssembly(); assembly.Id = 0; var assemblyController = new AssemblyController(); // Act var result = await assemblyController.Post(assembly); // Assert Assert.True(result.Success); Assert.NotNull(result.Data); }
static void Main(string[] args) { try { IAssemblyController controller = new AssemblyController(args); controller.AddAssembler(new Asm6502(controller)); controller.DisplayingBanner += DisplayBannerEventHandler; controller.WritingHeader += WriteHeaderEventHandler; controller.Assemble(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public async Task PostAssemblyComponentNormalTest() { // Arrange var component = MapAddAssemblyComponentVM(GetAssemblyComponent()); var assembly = GetAssembly(); component.AssemblyId = assembly.Id; var assemblyController = new AssemblyController(); // Act var result = await assemblyController.Post(component); // Assert Assert.True(result.Success); Assert.NotNull(result.Data); }
public void CreateTypeInstanceTest() { Assembly TestAssembly = AssemblyController <object> .CreateAssembly(@"..\..\..\Debug\StartUps\DefaultStartUp.dll"); int InstanceCount = 0; foreach (var Instance in AssemblyController <object> .CreateTypeInstance(TestAssembly)) { System.Diagnostics.Debug.Print(Instance.GetType().Name); InstanceCount++; } System.Diagnostics.Debug.Print(InstanceCount.ToString()); if (InstanceCount == 0) { Assert.Fail(); } InstanceCount = 0; foreach (var Instance in AssemblyController <object> .CreateTypeInstance(TestAssembly, "test")) { InstanceCount++; } System.Diagnostics.Debug.Print(InstanceCount.ToString()); if (InstanceCount != 0) { Assert.Fail(); } InstanceCount = 0; foreach (var Instance in AssemblyController <object> .CreateTypeInstance(TestAssembly, "DefaultStartUpClass")) { InstanceCount++; } System.Diagnostics.Debug.Print(InstanceCount.ToString()); if (InstanceCount != 1) { Assert.Fail(); } }
public MainWindow() { InitializeComponent(); AssemblyController ac = new AssemblyController("ClassLibrary.dll"); }