My test just has to check the call number of a given mocked method, nothing else.
The tested class and the embedded interface:
type
IMyInterface = interface ( IInvokable )
['{815BD1B0-77CB-435F-B4F3-9936001BA166}']
procedure bar;
end;
TMyClass = class
private
fMyInterface : IMyInterface;
public
procedure foo;
end;
procedure TMyClass.foo;
begin
if ( someCondition ) then
fMyInterface.bar;
end;
The test case:
procedure TMyClassUnitTest.foo_bar_NotCalled;
begin
fMyTestedObject.foo;
fMyInterfaceMock.Received( 0 ).bar;
end;
The runner says for foo_bar_NotCalled
:
No assertions were made during the test!
What else should I do? What method of the Assert should I call?