Пример #1
0
void MockCheckedActualCall::checkOutputParameter(const MockNamedValue& outputParameter)
{
	unfulfilledExpectations_.onlyKeepUnfulfilledExpectationsWithOutputParameter(outputParameter);

	if (unfulfilledExpectations_.isEmpty()) {
		MockUnexpectedOutputParameterFailure failure(getTest(), getName(), outputParameter, allExpectations_);
		failTest(failure);
		return;
	}

	unfulfilledExpectations_.outputParameterWasPassed(outputParameter.getName());
	finalizeCallWhenFulfilled();
}
Пример #2
0
MockActualCall& MockCheckedActualCall::onObject(void* objectPtr)
{
	unfulfilledExpectations_.onlyKeepUnfulfilledExpectationsOnObject(objectPtr);

	if (unfulfilledExpectations_.isEmpty()) {
		MockUnexpectedObjectFailure failure(getTest(), getName(), objectPtr, allExpectations_);
		failTest(failure);
		return *this;
	}

	unfulfilledExpectations_.wasPassedToObject();

	finalizeCallWhenFulfilled();
	return *this;
}
Пример #3
0
MockActualCall& MockCheckedActualCall::withName(const SimpleString& name)
{
    setName(name);
    callIsInProgress();

    unfulfilledExpectations_.onlyKeepExpectationsRelatedTo(name);
    if (unfulfilledExpectations_.isEmpty()) {
        MockUnexpectedCallHappenedFailure failure(getTest(), name, allExpectations_);
        failTest(failure);
        return *this;
    }

    unfulfilledExpectations_.callWasMade(callOrder_);

    finalizeCallWhenFulfilled();

    return *this;
}
Пример #4
0
void MockCheckedActualCall::checkInputParameter(const MockNamedValue& actualParameter)
{
    if(hasFailed())
    {
        return;
    }

    callIsInProgress();

    unfulfilledExpectations_.onlyKeepExpectationsWithInputParameter(actualParameter);

    if (unfulfilledExpectations_.isEmpty()) {
        MockUnexpectedInputParameterFailure failure(getTest(), getName(), actualParameter, allExpectations_);
        failTest(failure);
        return;
    }

    unfulfilledExpectations_.parameterWasPassed(actualParameter.getName());
    finalizeCallWhenFulfilled();
}