public void InvokeNullableCandidate_ReturnFalse(int?candidate, int?from, int?to) { var sut = new ExclusiveBetweenSpecification <int?>(from, to); var result = sut.GetNegationExpression().Compile().Invoke(candidate); Assert.False(result); }
public void NullableCandidate_ReturnFalse(int?candidate, int?from, int?to) { var sut = new ExclusiveBetweenSpecification <int?>(from, to); var result = sut.IsSatisfiedBy(candidate); Assert.False(result); }
public void InvokeExclusiveBetweenCandidate_ReturnFalse <T>(T candidate, T from, T to, IComparer <T> comparer) { candidate = candidate?.ToString() != "null" ? candidate : default; var sut = new ExclusiveBetweenSpecification <T>(from, to, comparer); var result = sut.GetNegationExpression().Compile().Invoke(candidate); Assert.False(result); }
public void NotExclusiveBetweenCandidate_ReturnFalse <T>(T candidate, T from, T to, IComparer <T> comparer) { candidate = candidate?.ToString() != "null" ? candidate : default; var sut = new ExclusiveBetweenSpecification <T>(from, to, comparer); var result = sut.IsSatisfiedBy(candidate); Assert.False(result); }
public void InvokeExclusiveBetween_ReturnExclusiveBetweenSpecification() { var comparer = new FakeIntComparer(); var expected = new ExclusiveBetweenSpecification <int>(0, 0, comparer); var sut = Specification.ExclusiveBetween(0, 0, comparer); Assert.Equal(expected, sut, new SpecificationComparer()); }
public void CorrectNullableCandidate_ReturnExpectedResultObject(int?candidate, int?from, int?to, SpecificationResult expected) { var sut = new ExclusiveBetweenSpecification <int?>(from, to); var overall = sut.IsSatisfiedBy(candidate, out var result); Assert.True(overall); Assert.Equal(expected, result, new SpecificationResultComparer()); }
public void NonGenericILinqSpecification_ReturnExpressionAsAbstractExpression() { var sut = new ExclusiveBetweenSpecification <string>(null, null); var expected = sut.GetExpression().ToString(); var sutExpression = ((ILinqSpecification)sut).GetExpression(); var result = sutExpression.ToString(); Assert.Equal(expected, result); }
public void NotExclusiveBetweenCandidate_ReturnExpectedResultObject <T>(T candidate, T from, T to, IComparer <T> comparer, SpecificationResult expected) { candidate = candidate?.ToString() != "null" ? candidate : default; var sut = new ExclusiveBetweenSpecification <T>(from, to, comparer); var overall = sut.IsSatisfiedBy(candidate, out var result); Assert.False(overall); Assert.Equal(expected, result, new SpecificationResultComparer(candidate)); }