コード例 #1
0
        public void ValidateObject_WithReturnValueIsNotBool_Throws()
        {
            var validatableModel = ValidatableModel.Valid();

            validatableModel.Invoking(it => it.TriggerValidationWithValidationMethodIsNoPredicate()).Should().Throw <PostconditionViolatedException>();
        }
コード例 #2
0
        public void ValidateObject_WithValidationMethodThrowsException_WrapsExceptionInPostconditionException()
        {
            var validatableModel = ValidatableModel.Valid();

            validatableModel.Invoking(it => it.TriggerValidationWithValidationMethodThrows()).Should().Throw <PostconditionViolatedException>().WithInnerException <TargetInvocationException>();
        }
コード例 #3
0
 public void ConstructorCall_WithInstanceIsValid_DoesNotThrow()
 {
     this.Invoking(_ => ValidatableModel.Valid()).Should().NotThrow();
 }