public void InvokeNullableCandidate_ReturnFalse(int?candidate, int?from, int?to) { var sut = new InclusiveBetweenSpecification <int?>(from, to); var result = sut.GetExpression().Compile().Invoke(candidate); Assert.False(result); }
public void InvokeInclusiveBetweenCandidate_ReturnTrue <T>(T candidate, T from, T to, IComparer <T> comparer) { candidate = candidate?.ToString() != "null" ? candidate : default; var sut = new InclusiveBetweenSpecification <T>(from, to, comparer); var result = sut.GetExpression().Compile().Invoke(candidate); Assert.True(result); }
public void NonGenericILinqSpecification_ReturnExpressionAsAbstractExpression() { var sut = new InclusiveBetweenSpecification <string>(null, null); var expected = sut.GetExpression().ToString(); var sutExpression = ((ILinqSpecification)sut).GetExpression(); var result = sutExpression.ToString(); Assert.Equal(expected, result); }