public void Assert(IQueryResults queryResult) { var querySpec = QuerySpecificationFrom(queryResult); var allReceivedCalls = AllCallsExceptPropertyGettersReceivedByTargetsOf(querySpec); var callsSpecifiedButNotReceived = GetCallsExpectedButNoReceived(querySpec, allReceivedCalls); var callsReceivedButNotSpecified = GetCallsReceivedButNotExpected(querySpec, allReceivedCalls); if (callsSpecifiedButNotReceived.Any() || callsReceivedButNotSpecified.Any()) { throw new CallSequenceNotFoundException(ExceptionMessage.For(querySpec, allReceivedCalls, callsSpecifiedButNotReceived, callsReceivedButNotSpecified, _queryFilter)); } }
private string GetExceptionMessage(CallSpecAndTarget[] querySpec, ICall[] matchingCallsInOrder) { return(ExceptionMessage.For(querySpec, matchingCallsInOrder, querySpec, matchingCallsInOrder, _queryFilter)); }