Exemple #1
0
        public void TestInvalidParameter()
        {
            var contrast = Contrast.CreateContrast();

            try
            {
                contrast.AddParameter(Model.Tools.Common.ParameterName.Brightness, new Parameter <Double>(150));
                Assert.Fail("The Parameter Name is not valid");
            }
            catch (Exception e)
            {
                Assert.True(true);
            }
        }
Exemple #2
0
        public void TestOutOfRangeParameter()
        {
            var contrast = Contrast.CreateContrast();

            contrast.AddParameter(Model.Tools.Common.ParameterName.Contrast, new Parameter <Double>(256));
            try
            {
                contrast.ApplyTool(_input);
                Assert.Fail("Should be between -255 and 255");
            }
            catch (Exception)
            {
                Assert.IsTrue(true);
            }
        }
Exemple #3
0
        public void TestDoubleParameter()
        {
            var contrast = Contrast.CreateContrast();

            contrast.AddParameter(Model.Tools.Common.ParameterName.Contrast, new Parameter <Double>(150.5));
            try
            {
                contrast.ApplyTool(_input);
                Assert.Fail("Should be an int");
            }
            catch (Exception)
            {
                Assert.IsTrue(true);
            }
        }
Exemple #4
0
        public void TestRepeatedParameter()
        {
            var contrast = Contrast.CreateContrast();

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