Пример #1
0
        public void SetZoneInputs_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, zlm.Zones.Select(z => z.Name), true, isv);

            isv.Speed = 90;

            //act
            zlmrpc.SetZoneInputs("Zone1", isv);

            //assert
            Assert.That(zone1.ZoneProgram.GetInput("Speed").Value, Is.EqualTo(90));
            Assert.That(zone2.ZoneProgram.GetInput("Speed").Value, Is.EqualTo(50));

            zlmrpc.Dispose();
        }