示例#1
0
        public void SupportsPercentageUnit()
        {
            var filter = SepiaFilter.Create(CallSyntax.Parse("sepia(50%)"));

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

            Assert.Equal(1, filter.Amount);
        }
示例#4
0
        public void Parse()
        {
            var filter = SepiaFilter.Create(CallSyntax.Parse("sepia(0.5)"));

            Assert.Equal(0.5, filter.Amount);
        }