Esempio n. 1
0
        public void GetZones_OneRunningOneStopped_Works()
        {
            string  programSetName = "RainbowSet";
            string  programName    = "Rainbow";
            dynamic isv            = new ISV();

            isv.Speed = 50;

            var zlm    = new ZLM(false, false, false);
            var zlmrpc = new ZLMRPC(zlm);
            var zone1  = zlm.AddFadeCandyZone("Zone1", PixelType.FadeCandyWS2812Pixel, 8, 1);
            var zone2  = zlm.AddFadeCandyZone("Zone2", PixelType.FadeCandyWS2812Pixel, 8, 1);

            zlm.CreateProgramSet(programSetName, programName, "Zone2".Listify(), true, isv);

            //act
            var zones = zlmrpc.GetZones();

            //assert
            Assert.That(zones.First(x => x.Name == "Zone1").Brightness, Is.EqualTo(zlm.Zones["Zone1"].Brightness));
            Assert.That(zones.First(x => x.Name == "Zone1").LightCount, Is.EqualTo(zlm.Zones["Zone1"].LightCount));
            Assert.That(zones.First(x => x.Name == "Zone1").Running, Is.EqualTo(zlm.Zones["Zone1"].Running));
            Assert.That(zones.First(x => x.Name == "Zone1").ZoneProgramName, Is.EqualTo(string.Empty).Or.EqualTo(null));

            Assert.That(zones.First(x => x.Name == "Zone2").Brightness, Is.EqualTo(zlm.Zones["Zone2"].Brightness));
            Assert.That(zones.First(x => x.Name == "Zone2").LightCount, Is.EqualTo(zlm.Zones["Zone2"].LightCount));
            Assert.That(zones.First(x => x.Name == "Zone2").Running, Is.EqualTo(zlm.Zones["Zone2"].Running));
            Assert.That(zones.First(x => x.Name == "Zone2").ZoneProgramName, Is.EqualTo(zlm.Zones["Zone2"].ZoneProgram.Name));

            zlmrpc.Dispose();
        }