Exemplo n.º 1
0
MockUnexpectedCallHappenedFailure::MockUnexpectedCallHappenedFailure(UtestShell* test, const SimpleString& name, const MockExpectedCallsList& expectations) : MockFailure(test)
{
    unsigned int amountOfExpectations = expectations.amountOfExpectationsFor(name);
    if (amountOfExpectations > 0) {
        SimpleString ordinalNumber = StringFromOrdinalNumber(amountOfExpectations + 1);
        message_ = StringFromFormat("Mock Failure: Unexpected additional (%s) call to function: ", ordinalNumber.asCharString());
    } else {
        message_ = "Mock Failure: Unexpected call to function: ";
    }
    message_ += name;
    message_ += "\n";
    addExpectationsAndCallHistory(expectations);
}