public void ValidateObject_WithReturnValueIsNotBool_Throws() { var validatableModel = ValidatableModel.Valid(); validatableModel.Invoking(it => it.TriggerValidationWithValidationMethodIsNoPredicate()).Should().Throw <PostconditionViolatedException>(); }
public void ValidateObject_WithValidationMethodThrowsException_WrapsExceptionInPostconditionException() { var validatableModel = ValidatableModel.Valid(); validatableModel.Invoking(it => it.TriggerValidationWithValidationMethodThrows()).Should().Throw <PostconditionViolatedException>().WithInnerException <TargetInvocationException>(); }
public void ConstructorCall_WithInstanceIsValid_DoesNotThrow() { this.Invoking(_ => ValidatableModel.Valid()).Should().NotThrow(); }