public void TestParameterNotEqualToPasses( string parameterName, sbyte?parameterValue, sbyte?valueToCompare, NullableNumericValidator <sbyte> validatorBase) { "Given a new ValidatorBase" .x(() => validatorBase = Validate.That(parameterName, parameterValue)); "Testing that the parameter value is equal to the value to compare against" .x(() => validatorBase.IsNotEqualTo(valueToCompare).OtherwiseThrowException()); "Should not result in an exception" .x(() => validatorBase.CurrentException.Should().BeNull()); }
public void TestParameterNotEqualToFails( string parameterName, sbyte?parameterValue, sbyte?valueToCompare, NullableNumericValidator <sbyte> validatorBase, Action act) { "Given a new ValidatorBase" .x(() => validatorBase = Validate.That(parameterName, parameterValue)); "Testing that the parameter value is equal to the value to compare against" .x(() => act = () => validatorBase.IsNotEqualTo(valueToCompare).OtherwiseThrowException()); "Should throw an exception" .x(() => act.ShouldThrow <ArgumentEqualityException>() .WithMessage(string.Format(Resources.MustNotBeEqualToX + "\r\nParameter name: {1}", valueToCompare, parameterName))); }