Пример #1
0
        public void SetAllZonesColor_Works()
        {
            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);

            zlmrpc.SetAllZonesColor("Blue", (float)0.5);

            zlm.Zones.ToList().ForEach(zone =>
                                       zone.SortedLights.ToList().ForEach(light =>
            {
                Assert.That(light.Value.GetColor().A, Is.EqualTo(255));
                Assert.That(light.Value.GetColor().B, Is.EqualTo(127));
                Assert.That(light.Value.GetColor().R, Is.EqualTo(0));
                Assert.That(light.Value.GetColor().G, Is.EqualTo(0));
            }));

            zlmrpc.Dispose();
        }