public void SetCtAbx_DurationValidator_validates_duration(int milliseconds, bool expected) { var rule = new Commands.SetCtAbx.SetCtAbxDurationRule(); var command = new Commands.SetCtAbx(0, Effect.Smooth, TimeSpan.FromMilliseconds(milliseconds)); rule.Validate(command).Should().Be(expected); }
public void SetCtAbx_DurationValidator_ignores_duration_if_sudden() { var rule = new Commands.SetCtAbx.SetCtAbxDurationRule(); var command = new Commands.SetCtAbx(0, Effect.Sudden, TimeSpan.Zero); rule.Validate(command).Should().BeTrue(); }
public void SetCtAbx_CtValueValidator_validates_temperature(int val, bool expected) { var rule = new Commands.SetCtAbx.CtValueRule(); var command = new Commands.SetCtAbx(val, Effect.Smooth, TimeSpan.Zero); rule.Validate(command).Should().Be(expected); }
public void SetCtAbx_converts_parameters() { var command1 = new Commands.SetCtAbx(123, Effect.Sudden, TimeSpan.FromSeconds(1)); var command2 = new Commands.SetCtAbx(123, Effect.Smooth, TimeSpan.FromSeconds(2)); command1.Tag(0).Params.Should().BeEquivalentTo(123, "sudden", 1000); command2.Tag(0).Params.Should().BeEquivalentTo(123, "smooth", 2000); }