public void NullCandidate_NoException(bool isValidable) { var specification = isValidable ? MockValidationSpecification.True() : MockSpecification.True(); var sut = new SpecificationAdapter <object>(specification); var exception = Record.Exception(() => sut.IsSatisfiedBy(null, out _)); Assert.Null(exception); }
public void TrueSpecification_ReturnTrue() { var specification = MockSpecification.True(); var sut = new SpecificationAdapter <object>(specification); var result = sut.IsSatisfiedBy(new object()); Assert.True(result); }
public void NullCandidate_NoException() { var specification = MockSpecification.True(); var sut = new SpecificationAdapter <object>(specification); var exception = Record.Exception(() => sut.IsSatisfiedBy(null)); Assert.Null(exception); }
public void TrueSpecification_ReturnExpectedResultObject(bool isValidable, SpecificationResult expected) { var specification = isValidable ? MockValidationSpecification.True() : MockSpecification.True(); var sut = new SpecificationAdapter <object>(specification); var overall = sut.IsSatisfiedBy(new object(), out var result); Assert.True(overall); Assert.Equal(expected, result, new SpecificationResultComparer()); }
public void RelatedTypes_NoException() { var specification = MockSpecification <IEnumerable <char> > .True(); var exception = Record.Exception(() => { var sut = new SpecificationAdapter <ChildFakeType>(specification); sut.IsSatisfiedBy(new ChildFakeType()); }); Assert.Null(exception); }