Beispiel #1
0
        // Color-based = can't represent invalid HSV?
        public void SetHsv_validations_work(
            ushort r, ushort g, ushort b, int ms,
            bool expectedRule1, bool expectedRule2, bool expectedRule3)
        {
            var command =
                new Commands.SetHsv(
                    Color.FromArgb(r, g, b),
                    Effect.Smooth,
                    TimeSpan.FromMilliseconds(ms));

            var rule1 = new Commands.SetHsv.SetHsvDurationRule();
            var rule2 = new Commands.SetHsv.HueRule();
            var rule3 = new Commands.SetHsv.SaturationRule();

            rule1.Validate(command).Should().Be(expectedRule1, "duration");
            rule2.Validate(command).Should().Be(expectedRule2, "hue");
            rule3.Validate(command).Should().Be(expectedRule3, "saturation");
        }
Beispiel #2
0
        public void SetHsv_uses_color()
        {
            var command = new Commands.SetHsv(Color.FromKnownColor(KnownColor.Azure), Effect.Smooth, TimeSpan.FromSeconds(1));

            command.GetParams().Should().BeEquivalentTo(180, 1, Effect.Smooth, TimeSpan.FromSeconds(1));
        }