Пример #1
0
	MockCheckedExpectedCall* addFunctionToExpectationsList(const SimpleString& name)
	{
		MockCheckedExpectedCall* newCall = new MockCheckedExpectedCall;
		newCall->withName(name);
		expectationsList->addExpectedCall(newCall);
		return newCall;
	}
Пример #2
0
void MockSupport::expectNoCall(const SimpleString& functionName)
{
    if (!enabled_) return;

    countCheck();

    MockCheckedExpectedCall* call = new MockCheckedExpectedCall;
    call->withName(appendScopeToName(functionName));
    unExpectations_.addExpectedCall(call);
}
Пример #3
0
MockExpectedCall& MockSupport::expectOneCall(const SimpleString& functionName)
{
	if (!enabled_) return MockIgnoredExpectedCall::instance();

	MockCheckedExpectedCall* call = new MockCheckedExpectedCall;
	call->withName(functionName);
	if (strictOrdering_)
		call->withCallOrder(++expectedCallOrder_);
	expectations_.addExpectedCall(call);
	return *call;
}
Пример #4
0
    void checkUnexpectedNthCallMessage(unsigned int count, const char* expectedOrdinal)
    {
        MockExpectedCallsList callList;
        MockCheckedExpectedCall expCall;

        expCall.withName("bar");
        for (unsigned int i = 0; i < (count - 1); i++) {
            expCall.callWasMade(1);
            callList.addExpectedCall(&expCall);
        }

        MockUnexpectedCallHappenedFailure failure(UtestShell::getCurrent(), "bar", callList);

        SimpleString expectedMessage = StringFromFormat("Mock Failure: Unexpected additional (%s) call to function: bar\n\tEXPECTED", expectedOrdinal);
        STRCMP_CONTAINS(expectedMessage.asCharString(), failure.getMessage().asCharString());
    }