Esempio n. 1
0
        public void GetMachinesWithDevices()
        {
            var machineManager = new MachineManager(mockedServiceProvider);
            var result         = machineManager.GetAllMachines().Select(m => m.HasDevices);

            Assert.IsNotNull(result, "Result was NULL");
            var count = result.Count();

            Assert.AreEqual(1, count, "COUNT failed");
        }
Esempio n. 2
0
        public void GetAllMachines()
        {
            var machineManager = new MachineManager(mockedServiceProvider);
            var result         = machineManager.GetAllMachines();

            Assert.IsNotNull(result, "Result was NULL"); // Test function
            var count = result.Count();

            Assert.AreEqual(2, count, "COUNT failed"); // Test function
        }
Esempio n. 3
0
        public void AddMachine()
        {
            var machineManager = new MachineManager(mockedServiceProvider);
            var testId         = 100;

            machineManager.AddMachine(new MachineDto {
                Id = testId, Name = "Added Machine", Location = "None", HasDevices = false
            });
            var all = machineManager.GetAllMachines();

            Assert.AreEqual(3, all.Count(), "Must be 3 machines");
            var single = machineManager.GetMachineById(testId);

            Assert.IsNotNull(single, "Added machine not found");
        }