public void NullCandidate_NoException(bool isNegatable) { var specification = isNegatable ? MockNegatableSpecification.True() : MockSpecification.True(); var sut = new SpecificationAdapter <object>(specification); var exception = Record.Exception(() => sut.IsNotSatisfiedBy(null)); Assert.Null(exception); }
public void TrueSpecification_ReturnFalse(bool isNegatable) { var specification = isNegatable ? MockNegatableSpecification.True() : MockSpecification.True(); var sut = new SpecificationAdapter <object>(specification); var result = sut.IsNotSatisfiedBy(new object()); Assert.False(result); }
public void FalseSpecification_ReturnExpectedResultObject(bool isNegatable, SpecificationResult expected) { var specification = isNegatable ? MockNegatableValidationSpecification.False() : MockSpecification.False(); var sut = new SpecificationAdapter <object>(specification); var overall = sut.IsNotSatisfiedBy(new object(), out var result); Assert.True(overall); Assert.Equal(expected, result, new SpecificationResultComparer()); }
public void RelatedNegatableTypes_NoException() { var specification = MockNegatableSpecification <IEnumerable <char> > .True(); var exception = Record.Exception(() => { var sut = new SpecificationAdapter <ChildFakeType>(specification); sut.IsNotSatisfiedBy(new ChildFakeType()); }); Assert.Null(exception); }