I am new to Mocking and Unit Testing in general. Please see the code below which I found online:
[Test]
public void CanQueryViewUseAccountServiceToFundsTransfer()
{
_viewMock.Expects.One.Method(v => v.GetSourceAccount()).WillReturn("1234");
_viewMock.Expects.One.GetProperty(v => v.TargetAccount).WillReturn("9876");
_viewMock.Expects.One.GetProperty(v => v.TransferAmount).WillReturn(200.00m);
_serviceMock.Expects.Exactly(1).Method(s => s.TransferFunds(null, null, 0m)).With("1234", "9876", 200.00m);
_presenter.Transfer_Clicked();
_mocks.VerifyAllExpectationsHaveBeenMet();
}
I cannot find any documentation at all that explain what the following lines do:
_viewMock.Expects.One.Method //Is this saying it is expecting one and only one function to be called?
_viewMock.Expects.One.GetProperty
I have tried to find answers myself. For example I looked here: http://nmock3.codeplex.com/documentation, but all I can find is FAQs.