public void OrIsNull_calls_And_with_arguments() { IClauseCollection <TestClass> clauseCollection = A.Fake <IClauseCollection <TestClass> >(); IClauseCollectionExtensions.OrIsNull(clauseCollection, x => x.Title); A.CallTo(() => clauseCollection.Or("Title", SqlOperator.Is, "null")).MustHaveHappened(); }
public void And_calls_And_with_arguments() { IClauseCollection clauseCollection = A.Fake <IClauseCollection>(); IClauseCollectionExtensions.And(clauseCollection, "foo", 2); A.CallTo(() => clauseCollection.And("foo", SqlOperator.Equal, 2)).MustHaveHappened(); }
public void Or_calls_Add_with_arguments() { IClauseCollection clauseCollection = A.Fake <IClauseCollection>(); IClauseCollectionExtensions.Or(clauseCollection, "1=1"); // assert the 2nd argument of Add() was called with the clause argument where the sql matches and with the correct operator A.CallTo(() => clauseCollection.Add("And", A <Clause> .Ignored)) .WhenArgumentsMatch(x => { return (x.Get <string>(0) == "Or" && x.Get <Clause>(1).Sql() == "1=1"); }).MustHaveHappened(); }