public void CorrectLinqSpecification_ReturnBaseExpression() { Expression <Func <object, bool> > expected = obj => true; var specification = new MockLinqSpecification <object>(expected); var sut = new SpecificationAdapter <object>(specification); var result = sut.GetExpression(); Assert.Equal(expected, result); }
public void RelatedLinqTypes_ReturnIsSatisfiedByExecutionInExpression() { Expression <Func <IEnumerable <char>, bool> > expected = candidate => true; ISpecification <IEnumerable <char> > sut = new MockLinqSpecification <IEnumerable <char> >(expected); var expression = sut.AsExpression <ChildFakeType>(); var result = expression.ToString(); Assert.Matches(@"candidate => .*\.IsSatisfiedBy\(candidate\)", result); }
public void ILinqSpecification_ReturnBaseExpression() { Expression <Func <object, bool> > expected = candidate => true; ISpecification <object> sut = new MockLinqSpecification <object>(expected); var result = sut.AsExpression(); Assert.NotNull(result); Assert.Equal(expected, result); }
public void InvokeRelatedTypes_NoException() { var specification = new MockLinqSpecification <IEnumerable <char> >(obj => true); var exception = Record.Exception(() => { var sut = new SpecificationAdapter <ChildFakeType>(specification); sut.GetExpression().Compile().Invoke(new ChildFakeType()); }); Assert.Null(exception); }