public void NullableCandidate_ReturnFalse(int?candidate, int?greaterThan) { var sut = new GreaterThanOrEqualSpecification <int?>(greaterThan); var result = sut.IsSatisfiedBy(candidate); Assert.False(result); }
public void NotGreaterThanOrEqualCandidate_ReturnFalse <T>(T candidate, T greaterThan, IComparer <T> comparer) { candidate = candidate?.ToString() != "null" ? candidate : default; var sut = new GreaterThanOrEqualSpecification <T>(greaterThan, comparer); var result = sut.IsSatisfiedBy(candidate); Assert.False(result); }
public void CorrectNullableCandidate_ReturnExpectedResultObject(int?candidate, int?greaterThan, SpecificationResult expected) { var sut = new GreaterThanOrEqualSpecification <int?>(greaterThan); var overall = sut.IsSatisfiedBy(candidate, out var result); Assert.True(overall); Assert.Equal(expected, result, new SpecificationResultComparer()); }
public void NotGreaterThanOrEqualCandidate_ReturnExpectedResultObject <T>(T candidate, T greaterThan, IComparer <T> comparer, SpecificationResult expected) { candidate = candidate?.ToString() != "null" ? candidate : default; var sut = new GreaterThanOrEqualSpecification <T>(greaterThan, comparer); var overall = sut.IsSatisfiedBy(candidate, out var result); Assert.False(overall); Assert.Equal(expected, result, new SpecificationResultComparer(candidate)); }