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); } }
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); } }
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); } }
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); } }