예제 #1
0
        public void GetDevicesOfMachine()
        {
            var machineManager = new MachineManager(mockedServiceProvider);
            var machine        = new Machine {
                Id = 99
            };
            var result = machineManager.GetDevicesOfMachine(machine);

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

            Assert.AreEqual(2, count, "COUNT failed");
            // negative, no devices
            machine.Id = 1;
            result     = machineManager.GetDevicesOfMachine(machine);
            Assert.IsNotNull(result, "Result was NULL");
            count = result.Count();
            Assert.AreEqual(0, count, "COUNT failed");
            // false, no machine
            machine.Id = 4;
            result     = machineManager.GetDevicesOfMachine(machine);
            Assert.IsNull(result, "Result was not NULL");
        }