예제 #1
0
        public void ConcreteFunctionTest2()
        {
            List <Command> commands = new List <Command>();

            commands.Add(new SendNuvoCommand(new SimpleId(), false, false, false, false, false, true, true, new Address("100.1"), "OFF", "100.6", 10));

            List <DayOfWeek> dayOfWeek = new List <DayOfWeek>();

            dayOfWeek.Add(DayOfWeek.Monday);
            dayOfWeek.Add(DayOfWeek.Tuesday);
            dayOfWeek.Add(DayOfWeek.Wednesday);
            dayOfWeek.Add(DayOfWeek.Thursday);
            dayOfWeek.Add(DayOfWeek.Friday);
            dayOfWeek.Add(DayOfWeek.Saturday);
            dayOfWeek.Add(DayOfWeek.Sunday);
            TimeSpan validFrom = new TimeSpan(0, 0, 1);     // NOTE: (0,0,0) is considered as "not set" (not used)
            TimeSpan validTo   = new TimeSpan(23, 59, 59);

            ZoneChangeFunction             function     = new ZoneChangeFunction(new SimpleId(), new Address("100.1"), new Address(), 0, true, true, true, true, dayOfWeek, validFrom, validTo, commands);
            ZoneServerMock                 zoneServer   = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = new Dictionary <int, IAudioDriver>();

            audioDrivers.Add(2, new AudioDriverMock());
            ConcreteFunctionTestClass target = new ConcreteFunctionTestClass(function, zoneServer, audioDrivers);

            // no validity defined -> per default valid
            Assert.AreEqual(true, target.Active);
            Assert.AreEqual(true, target.isActiveAt(DateTime.Now));
            Assert.AreEqual(true, target.isFunctionActiveToday(DateTime.Now));
            Assert.AreEqual(true, target.isFunctionActiveToday(DateTime.Now));

            // Check configuration and mock objects
            Assert.AreEqual(1, target.Function.Commands.Count);
            Assert.AreEqual(0, zoneServer.ZoneStateList.Count);
        }
        public void calculateFunctionTest2()
        {
            SleepFunction function = new SleepFunction(SimpleId.NewGuid(), new Address(100, 1),
                                                       new TimeSpan(1, 0, 0), new TimeSpan(0, 0, 0), new TimeSpan(23, 59, 59));
            ZoneServerMock zoneServer = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = null;
            ConcreteSleepFunction          target       = new ConcreteSleepFunction(function, zoneServer, audioDrivers);

            /* // not supported anymore; quick-fix, uncomment unit test ->
             *
             * // notify the first time, the update time is set to the current update time
             * ZoneStateEventArgs e1 = new ZoneStateEventArgs(new NuvoControl.Common.ZoneState(new Address(100, 1), true, 20, NuvoControl.Common.ZoneQuality.Online));
             * target.notifyOnZoneUpdate(e1);
             * Assert.AreEqual(e1.ZoneState.LastUpdate, target._lastZoneChangeToON);
             *
             * DateTime aktTime = DateTime.Now;
             * target.calculateFunction(aktTime);
             *
             * DateTime nextTime = DateTime.Now + new TimeSpan(1, 0, 0);
             * target.calculateFunction(nextTime);
             *
             * Assert.AreEqual(1, zoneServer._monitoredZones.Count);   // 1 zone monitored
             * Assert.AreEqual(1, zoneServer.ZoneStates.Count);       // 1 command issued
             * Assert.AreEqual(false, zoneServer.ZoneStates[new Address(100,1)].PowerStatus);   // switch off
             *
             */
        }
예제 #3
0
        public void ConcreteFunctionTest10a()
        {
            List <Command> commands = new List <Command>();

            commands.Add(new SendNuvoCommand(new SimpleId(), true, false, false, false, false, true, true, new Address("100.1"), "ON", "100.6", 10));

            List <DayOfWeek> dayOfWeek = null;
            TimeSpan         validFrom = new TimeSpan(0, 0, 0); // NOTE: (0,0,0) is considered as "not set" (not used)
            TimeSpan         validTo   = new TimeSpan(0, 0, 0);

            ZoneChangeFunction             function     = new ZoneChangeFunction(new SimpleId(), new Address("100.1"), new Address(), 0, true, true, true, true, dayOfWeek, validFrom, validTo, commands);
            ZoneServerMock                 zoneServer   = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = new Dictionary <int, IAudioDriver>();

            audioDrivers.Add(2, new AudioDriverMock());
            ConcreteFunctionTestClass target = new ConcreteFunctionTestClass(function, zoneServer, audioDrivers);

            // no validity defined -> per default valid
            Assert.AreEqual(true, target.Active);

            // execute events ...
            target.onFunctionError();

            // Check configuration and mock objects
            Assert.AreEqual(1, target.Function.Commands.Count);
            Assert.AreEqual(1, zoneServer.ZoneStateList.Count);
            Assert.AreEqual(true, zoneServer.ZoneStateList[0].PowerStatus);
        }
        public void ConcreteZoneChangeFunctionCommandTest13()
        {
            List <Command> commands = new List <Command>();

            commands.Add(new SendNuvoCommand(new SimpleId(), false, false, false, true, true, true, true, new Address("100.1"), "OFF", "100.6", 10));
            commands.Add(new PlaySoundCommand(new SimpleId(), false, false, false, true, true, true, true, new Address("100.2"), "http://www.imfeld.net/mp3_stream"));
            ZoneChangeFunction             function     = new ZoneChangeFunction(new SimpleId(), new Address("100.1"), new Address(), 0, true, true, true, true, null, new TimeSpan(), new TimeSpan(), commands);
            ZoneServerMock                 zoneServer   = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = new Dictionary <int, IAudioDriver>();

            audioDrivers.Add(2, new AudioDriverMock());
            ConcreteZoneChangeFunction target = new ConcreteZoneChangeFunction(function, zoneServer, audioDrivers);

            target.calculateFunction(DateTime.Now);

            zoneServer.distributeZoneState(new ZoneState(new Address("100.6"), true, 10, ZoneQuality.Online));
            zoneServer.distributeZoneState(new ZoneState(new Address("100.5"), false, 20, ZoneQuality.Online));
            zoneServer.distributeZoneState(new ZoneState(new Address("100.4"), true, 20, ZoneQuality.Offline));

            target.calculateFunction(DateTime.Now);

            Assert.AreEqual(true, target.Active);                                                               // function is "active"
            Assert.AreEqual(1, zoneServer.ZoneStateList.Count);                                                 // OnValidityStart
            Assert.AreEqual("http://www.imfeld.net/mp3_stream", ((AudioDriverMock)audioDrivers[2]).Url);        // URL is playing
            Assert.AreEqual(true, ((AudioDriverMock)audioDrivers[2]).IsPlaying);                                // URL is still playing
        }
        public void ConcreteZoneChangeFunctionCommandTest14()
        {
            List <Command> commands = new List <Command>();

            commands.Add(new SendNuvoCommand(new SimpleId(), false, false, false, true, true, true, true, new Address("100.1"), "OFF", "100.6", 10));
            commands.Add(new PlaySoundCommand(new SimpleId(), false, false, false, true, true, true, true, new Address("100.2"), "http://www.imfeld.net/mp3_stream"));
            ZoneChangeFunction             function     = new ZoneChangeFunction(new SimpleId(), new Address("100.1"), new Address(), 0, true, true, true, true, null, new TimeSpan(14, 0, 0), new TimeSpan(15, 0, 0), commands);
            ZoneServerMock                 zoneServer   = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = new Dictionary <int, IAudioDriver>();

            audioDrivers.Add(2, new AudioDriverMock());
            ConcreteZoneChangeFunction target = new ConcreteZoneChangeFunction(function, zoneServer, audioDrivers);

            target.calculateFunction(new DateTime(2016, 2, 24, 10, 0, 0));
            //Assert.AreEqual(false, target.Active);                                                              // function is not active
            Assert.AreEqual(0, zoneServer.ZoneStateList.Count);                                                 // no command in queue
            Assert.AreEqual("", ((AudioDriverMock)audioDrivers[2]).Url);                                        // no URL is playing
            Assert.AreEqual(false, ((AudioDriverMock)audioDrivers[2]).IsPlaying);                               // not playing

            zoneServer.distributeZoneState(new ZoneState(new Address("100.6"), true, 10, ZoneQuality.Online));
            zoneServer.distributeZoneState(new ZoneState(new Address("100.5"), false, 20, ZoneQuality.Online));
            zoneServer.distributeZoneState(new ZoneState(new Address("100.4"), true, 20, ZoneQuality.Offline));

            target.calculateFunction(new DateTime(2016, 2, 24, 12, 0, 0));
            Assert.AreEqual(false, target.isActiveAt(new DateTime(2016, 2, 24, 12, 0, 0)));                     // function is not active
            Assert.AreEqual(0, zoneServer.ZoneStateList.Count);                                                 // no command in queue
            Assert.AreEqual("", ((AudioDriverMock)audioDrivers[2]).Url);                                        // no URL is playing
            Assert.AreEqual(false, ((AudioDriverMock)audioDrivers[2]).IsPlaying);                               // not playing

            target.calculateFunction(new DateTime(2016, 2, 24, 13, 59, 59));
            Assert.AreEqual(false, target.isActiveAt(new DateTime(2016, 2, 24, 13, 59, 59)));                   // function is not active
            Assert.AreEqual(0, zoneServer.ZoneStateList.Count);                                                 // no command in queue
            Assert.AreEqual("", ((AudioDriverMock)audioDrivers[2]).Url);                                        // no URL is playing
            Assert.AreEqual(false, ((AudioDriverMock)audioDrivers[2]).IsPlaying);                               // not playing

            target.calculateFunction(new DateTime(2016, 2, 24, 14, 0, 0));
            Assert.AreEqual(true, target.isActiveAt(new DateTime(2016, 2, 24, 14, 0, 0)));                      // function is active
            Assert.AreEqual(1, zoneServer.ZoneStateList.Count);                                                 // one command in queue
            Assert.AreEqual("http://www.imfeld.net/mp3_stream", ((AudioDriverMock)audioDrivers[2]).Url);        // URL is playing
            Assert.AreEqual(true, ((AudioDriverMock)audioDrivers[2]).IsPlaying);                                // is playing

            target.calculateFunction(new DateTime(2016, 2, 24, 14, 0, 1));
            Assert.AreEqual(true, target.isActiveAt(new DateTime(2016, 2, 24, 14, 0, 1)));                      // function not active
            Assert.AreEqual(1, zoneServer.ZoneStateList.Count);                                                 // no new command in queue
            Assert.AreEqual("http://www.imfeld.net/mp3_stream", ((AudioDriverMock)audioDrivers[2]).Url);        // URL is still playing
            Assert.AreEqual(true, ((AudioDriverMock)audioDrivers[2]).IsPlaying);                                // is playing

            target.calculateFunction(new DateTime(2016, 2, 24, 15, 0, 0));
            Assert.AreEqual(true, target.isActiveAt(new DateTime(2016, 2, 24, 15, 0, 0)));                      // function is active
            Assert.AreEqual(1, zoneServer.ZoneStateList.Count);                                                 // one command in queue
            Assert.AreEqual("http://www.imfeld.net/mp3_stream", ((AudioDriverMock)audioDrivers[2]).Url);        // URL is playing
            Assert.AreEqual(true, ((AudioDriverMock)audioDrivers[2]).IsPlaying);                                // is playing

            target.calculateFunction(new DateTime(2016, 2, 24, 15, 0, 1));
            Assert.AreEqual(false, target.isActiveAt(new DateTime(2016, 2, 24, 15, 0, 1)));                     // function not active anymore
            Assert.AreEqual(2, zoneServer.ZoneStateList.Count);                                                 // second command in queue
            Assert.AreEqual("", ((AudioDriverMock)audioDrivers[2]).Url);                                        // no URL is playing
            Assert.AreEqual(false, ((AudioDriverMock)audioDrivers[2]).IsPlaying);                               // not playing anymore
        }
예제 #6
0
        public void ConcreteFunctionTest3()
        {
            List <Command> commands = new List <Command>();

            commands.Add(new SendNuvoCommand(new SimpleId(), false, false, false, false, false, true, true, new Address("100.1"), "OFF", "100.6", 10));

            List <DayOfWeek> dayOfWeek = new List <DayOfWeek>();

            //dayOfWeek.Add(DayOfWeek.Monday); -> not valid on Monday
            dayOfWeek.Add(DayOfWeek.Tuesday);
            dayOfWeek.Add(DayOfWeek.Wednesday);
            dayOfWeek.Add(DayOfWeek.Thursday);
            dayOfWeek.Add(DayOfWeek.Friday);
            dayOfWeek.Add(DayOfWeek.Saturday);
            dayOfWeek.Add(DayOfWeek.Sunday);
            TimeSpan validFrom = new TimeSpan(0, 0, 1);     // NOTE: (0,0,0) is considered as "not set" (not used)
            TimeSpan validTo   = new TimeSpan(23, 59, 59);

            ZoneChangeFunction             function     = new ZoneChangeFunction(new SimpleId(), new Address("100.1"), new Address(), 0, true, true, true, true, dayOfWeek, validFrom, validTo, commands);
            ZoneServerMock                 zoneServer   = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = new Dictionary <int, IAudioDriver>();

            audioDrivers.Add(2, new AudioDriverMock());
            ConcreteFunctionTestClass target = new ConcreteFunctionTestClass(function, zoneServer, audioDrivers);

            // 22.02.2016 is Monday
            //Assert.AreEqual(true, target.Active); --> works only with current date+time
            Assert.AreEqual(true, target.isActiveAt(new DateTime(2016, 2, 21, 23, 59, 59)));
            Assert.AreEqual(true, target.isFunctionActiveToday(new DateTime(2016, 2, 21, 23, 59, 59)));
            Assert.AreEqual(true, target.isFunctionActiveRightNow(new DateTime(2016, 2, 21, 23, 59, 59)));

            Assert.AreEqual(false, target.isActiveAt(new DateTime(2016, 2, 22, 0, 0, 0)));                  // considers TIME + DATE
            Assert.AreEqual(false, target.isFunctionActiveToday(new DateTime(2016, 2, 22, 0, 0, 0)));       // considers only DATE
            Assert.AreEqual(false, target.isFunctionActiveRightNow(new DateTime(2016, 2, 22, 0, 0, 0)));    // considers only TIME
            Assert.AreEqual(false, target.isActiveAt(new DateTime(2016, 2, 22, 23, 59, 59)));
            Assert.AreEqual(false, target.isFunctionActiveToday(new DateTime(2016, 2, 22, 23, 59, 59)));
            Assert.AreEqual(true, target.isFunctionActiveRightNow(new DateTime(2016, 2, 22, 23, 59, 58)));  // considers only TIME
            Assert.AreEqual(true, target.isFunctionActiveRightNow(new DateTime(2016, 2, 22, 23, 59, 59)));  // considers only TIME

            Assert.AreEqual(false, target.isActiveAt(new DateTime(2016, 2, 23, 0, 0, 0)));                  // considers TIME + DATE
            Assert.AreEqual(true, target.isActiveAt(new DateTime(2016, 2, 23, 0, 0, 1)));                   // considers TIME + DATE
            Assert.AreEqual(true, target.isFunctionActiveToday(new DateTime(2016, 2, 23, 0, 0, 0)));        // considers only DATE
            Assert.AreEqual(true, target.isFunctionActiveToday(new DateTime(2016, 2, 23, 0, 0, 1)));        // considers only DATE
            Assert.AreEqual(false, target.isFunctionActiveRightNow(new DateTime(2016, 2, 23, 0, 0, 0)));    // considers only TIME
            Assert.AreEqual(true, target.isFunctionActiveRightNow(new DateTime(2016, 2, 23, 0, 0, 1)));     // considers only TIME

            // Check configuration and mock objects
            Assert.AreEqual(1, target.Function.Commands.Count);
            Assert.AreEqual(0, zoneServer.ZoneStateList.Count);
        }
        public void calculateFunctionTest3()
        {
            SleepFunction function = new SleepFunction(SimpleId.NewGuid(), new Address(100, 1),
                                                       new TimeSpan(1, 0, 0), new TimeSpan(14, 0, 0), new TimeSpan(18, 00, 00));
            ZoneServerMock zoneServerMock = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = null;
            ConcreteSleepFunction          target       = new ConcreteSleepFunction(function, zoneServerMock, audioDrivers);

            Assert.AreEqual(1, zoneServerMock._monitoredZones.Count);   // 1 zone monitored

            // Distribute an 'old status. Simulate that the zone is ON since then.
            ZoneState oldState = new ZoneState(new Address(100, 1), true, 20, NuvoControl.Common.ZoneQuality.Online);

            oldState.LastUpdate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 8, 00, 0);
            zoneServerMock.distributeZoneState(oldState);

            // test 11:00 -> not active, no action
            DateTime simTime1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 11, 00, 0);

            target.calculateFunction(simTime1);
            Assert.AreEqual(0, zoneServerMock.ZoneStates.Count);       // 0 command issued

            // test 14:00 -> just active, switch off.
            DateTime simTime2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 14, 00, 0);

            target.calculateFunction(simTime2);
            Assert.AreEqual(1, zoneServerMock.ZoneStates.Count);       // 1 command issued
            zoneServerMock.ClearZoneStateList();

            // test 16:00 -> active, switch off.
            DateTime simTime3 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 16, 00, 0);

            target.calculateFunction(simTime3);
            Assert.AreEqual(1, zoneServerMock.ZoneStates.Count);       // 1 command issued
            zoneServerMock.ClearZoneStateList();

            // test 18:00 -> still active, switch off.
            DateTime simTime4 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 18, 00, 0);

            target.calculateFunction(simTime4);
            Assert.AreEqual(1, zoneServerMock.ZoneStates.Count);       // 1 command issued
            zoneServerMock.ClearZoneStateList();

            // test 20:00 -> not active, no action
            DateTime simTime5 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 20, 00, 0);

            target.calculateFunction(simTime5);
            Assert.AreEqual(0, zoneServerMock.ZoneStates.Count);       // 0 command issued
        }
        public void ConcreteZoneChangeFunctionCommandTest7()
        {
            List <Command> commands = new List <Command>();

            commands.Add(new SendNuvoCommand(new SimpleId(), true, true, true, true, true, true, true, new Address("100.1"), "OFF", "100.6", 10));
            ZoneChangeFunction             function     = new ZoneChangeFunction(new SimpleId(), new Address("100.1"), new Address("100.6"), 10, null, commands);
            ZoneServerMock                 zoneServer   = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = null;
            ConcreteZoneChangeFunction     target       = new ConcreteZoneChangeFunction(function, zoneServer, audioDrivers);

            zoneServer.distributeZoneState(new ZoneState(new Address("100.6"), true, 10, ZoneQuality.Online));
            zoneServer.distributeZoneState(new ZoneState(new Address("100.5"), false, 20, ZoneQuality.Online));

            target.calculateFunction(DateTime.Now);

            Assert.AreEqual(1, zoneServer.ZoneStateList.Count);     // OnValidityStart
        }
예제 #9
0
        public void ConcreteFunctionTest1()
        {
            List <Command> commands = new List <Command>();

            commands.Add(new SendNuvoCommand(new SimpleId(), false, false, false, false, false, true, true, new Address("100.1"), "OFF", "100.6", 10));
            ZoneChangeFunction             function     = new ZoneChangeFunction(new SimpleId(), new Address("100.1"), new Address(), 0, true, true, true, true, null, new TimeSpan(), new TimeSpan(), commands);
            ZoneServerMock                 zoneServer   = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = new Dictionary <int, IAudioDriver>();

            audioDrivers.Add(2, new AudioDriverMock());
            ConcreteFunctionTestClass target = new ConcreteFunctionTestClass(function, zoneServer, audioDrivers);

            // no validity defined -> per default valid
            Assert.AreEqual(true, target.Active);
            Assert.AreEqual(true, target.isActiveAt(DateTime.Now));
            Assert.AreEqual(true, target.isFunctionActiveToday(DateTime.Now));
            Assert.AreEqual(true, target.isFunctionActiveToday(DateTime.Now));

            // Check configuration and mock objects
            Assert.AreEqual(1, target.Function.Commands.Count);
            Assert.AreEqual(0, zoneServer.ZoneStateList.Count);
        }
        public void calculateFunctionTest4()
        {
            // (1) Day list: Monday, Wednesday, Friday, Sunday
            // (1) Function: AlarmTime=10:00, AlarmDuration=01:45
            #region Function1
            List <DayOfWeek> _dayOfWeeks1 = new List <DayOfWeek>();
            _dayOfWeeks1.Add(DayOfWeek.Monday);
            _dayOfWeeks1.Add(DayOfWeek.Wednesday);
            _dayOfWeeks1.Add(DayOfWeek.Friday);
            _dayOfWeeks1.Add(DayOfWeek.Sunday);
            AlarmFunction function1 = new AlarmFunction(
                SimpleId.NewGuid(),
                new Address(100, 1), new Address(100, 3), 50,
                new TimeSpan(10, 0, 0), new TimeSpan(1, 45, 0),
                _dayOfWeeks1);
            ZoneServerMock zoneServer1 = new ZoneServerMock();
            Dictionary <int, IAudioDriver> audioDrivers = null;
            ConcreteAlarmFunction          target1      = new ConcreteAlarmFunction(function1, zoneServer1, audioDrivers);
            #endregion

            // (2) Day list: Tuesday, Thursday, Saturday, Sunday
            // (2) Function: AlarmTime=10:00, AlarmDuration=01:45
            #region Function2
            List <DayOfWeek> _dayOfWeeks2 = new List <DayOfWeek>();
            _dayOfWeeks2.Add(DayOfWeek.Tuesday);
            _dayOfWeeks2.Add(DayOfWeek.Thursday);
            _dayOfWeeks2.Add(DayOfWeek.Saturday);
            _dayOfWeeks2.Add(DayOfWeek.Sunday);
            AlarmFunction function2 = new AlarmFunction(
                SimpleId.NewGuid(),
                new Address(100, 1), new Address(100, 6), 50,
                new TimeSpan(10, 0, 0), new TimeSpan(1, 45, 0),
                _dayOfWeeks2);
            ZoneServerMock        zoneServer2 = new ZoneServerMock();
            ConcreteAlarmFunction target2     = new ConcreteAlarmFunction(function2, zoneServer2, audioDrivers);
            #endregion

            ZoneState zoneStateOff1 = new ZoneState(new Address(100, 2), false, 20, ZoneQuality.Online);
            zoneStateOff1.LastUpdate = new DateTime(2009, 9, 12, 23, 0, 0);
            ZoneState zoneStateOn = new ZoneState(new Address(100, 2), true, 20, ZoneQuality.Online);
            zoneStateOn.LastUpdate = new DateTime(2009, 9, 12, 23, 5, 0);
            ZoneState zoneStateOff2 = new ZoneState(new Address(100, 2), false, 20, ZoneQuality.Online);
            zoneStateOff2.LastUpdate = new DateTime(2009, 9, 12, 23, 10, 0);

            // Sunday (13.9.2009 11:00)
            zoneServer1.distributeZoneState(zoneStateOff1);
            zoneServer1.distributeZoneState(zoneStateOn);    // sets the member LastChangeToON
            zoneServer1.distributeZoneState(zoneStateOff2);
            target1.calculateFunction(new DateTime(2009, 9, 13, 11, 0, 0));

            zoneServer2.distributeZoneState(zoneStateOff1);
            zoneServer2.distributeZoneState(zoneStateOn);                     // sets the member LastChangeToON
            zoneServer2.distributeZoneState(zoneStateOff2);
            target2.calculateFunction(new DateTime(2009, 9, 13, 11, 44, 59)); // last change before functions ends

            Assert.AreEqual(1, zoneServer1._monitoredZones.Count);
            Assert.AreEqual(1, zoneServer2._monitoredZones.Count);
            Assert.AreEqual(1, zoneServer1.ZoneStates.Count);  // 1 command has been sent
            Assert.AreEqual(true, zoneServer1.ZoneStates[new Address(100, 1)].PowerStatus);
            Assert.AreEqual(new Address(100, 3), zoneServer1.ZoneStates[new Address(100, 1)].Source);
            Assert.AreEqual(1, zoneServer2.ZoneStates.Count);  // 1 command has been sent
            Assert.AreEqual(true, zoneServer2.ZoneStates[new Address(100, 1)].PowerStatus);
            Assert.AreEqual(new Address(100, 6), zoneServer2.ZoneStates[new Address(100, 1)].Source);
            zoneServer1.ClearZoneStateList();
            zoneServer2.ClearZoneStateList();
        }