public virtual void TestParameterNotNullPasses(string parameterName, bool?parameterValue, NullableBooleanValidator validatorBase) { "Given a new ValidatorBase" .x(() => validatorBase = Validate.That(parameterName, parameterValue)); "Testing that the parameter is not null" .x(() => validatorBase.IsNotNull().OtherwiseThrowException()); "Should not result in an exception" .x(() => validatorBase.CurrentException.Should().BeNull()); }
public virtual void TestParameterNotNullFails(string parameterName, bool?parameterValue, NullableBooleanValidator validatorBase, Action act) { "Given a new ValidatorBase" .x(() => validatorBase = Validate.That(parameterName, parameterValue)); "Testing that the parameter is not null" .x(() => act = () => validatorBase.IsNotNull().OtherwiseThrowException()); "Should throw an exception" .x(() => act.ShouldThrow <ArgumentNullException>() .WithMessage(string.Format(Properties.Resources.MustNotBeNull + "\r\nParameter name: {0}", parameterName))); }