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 And_calls_Add_with_arguments() { IClauseCollection clauseCollection = A.Fake <IClauseCollection>(); IClauseCollectionExtensions.And(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) == "And" && x.Get <Clause>(1).Sql() == "1=1"); }).MustHaveHappened(); }