示例#1
0
        public void TestInvalidParameter()
        {
            var saturation = Saturation.CreateSaturation();

            try
            {
                saturation.AddParameter(Model.Tools.Common.ParameterName.Hue, new Model.Tools.Common.Parameter <Double>(150));
                Assert.Fail("The Parameter Name is not valid");
            }
            catch (Exception)
            {
                Assert.IsTrue(true);
            }
        }
示例#2
0
        public void TestOutOfRangeParameter()
        {
            var saturation = Saturation.CreateSaturation();

            saturation.AddParameter(Model.Tools.Common.ParameterName.Saturation, new Model.Tools.Common.Parameter <double>(2));
            try
            {
                saturation.ApplyTool(_target);
                Assert.Fail("Should be between -1 and 1");
            }
            catch (Exception)
            {
                Assert.IsTrue(true);
            }
        }
示例#3
0
        public void TestRepeatedParameter()
        {
            var saturation = Saturation.CreateSaturation();

            saturation.AddParameter(Model.Tools.Common.ParameterName.Saturation, new Model.Tools.Common.Parameter <Double>(1));
            try
            {
                saturation.AddParameter(Model.Tools.Common.ParameterName.Saturation, new Model.Tools.Common.Parameter <Double>(150));
                Assert.Fail("You need to remove the parameter first");
            }
            catch (Exception)
            {
                Assert.IsTrue(true);
            }
        }