예제 #1
0
        public AssemblyControllerTest()
        {
            mockAssemblyService = new MockAssemblyService();
            ILogger <AssemblyController> mockLogger = MockLogger <AssemblyController> .CreateMockLogger();

            assemblyController = new AssemblyController(mockAssemblyService, mockLogger);
        }
예제 #2
0
        public async Task GetAssembliesNormalTest()
        {
            // Arrange
            var assemblyController = new AssemblyController();

            // Act
            var result = await assemblyController.Get();

            // Assert
            Assert.True(result.Success);
            Assert.NotNull(result.Data);
        }
예제 #3
0
 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");
 }
예제 #4
0
        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);
        }
예제 #5
0
 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();
     }
 }
예제 #6
0
        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);
        }
예제 #7
0
파일: Program.cs 프로젝트: nixjoe/6502.Net
 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);
     }
 }
예제 #8
0
        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);
        }
예제 #9
0
        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");
        }