public void SupportsPercentageUnit() { var filter = SepiaFilter.Create(CallSyntax.Parse("sepia(50%)")); Assert.Equal(0.5, filter.Amount); }
public void ThrowsWheNegtive() { Assert.Throws <ArgumentOutOfRangeException>(() => SepiaFilter.Create(CallSyntax.Parse("sepia(-1%)"))); }
public void ClampsWhenGreaterThan100P() { var filter = SepiaFilter.Create(CallSyntax.Parse("sepia(101%)")); Assert.Equal(1, filter.Amount); }
public void Parse() { var filter = SepiaFilter.Create(CallSyntax.Parse("sepia(0.5)")); Assert.Equal(0.5, filter.Amount); }