I'm trying to write a test method for one of my controller methods. Here is the controller method
public ActionResult LicenseDetails(Guid id)
{
var licenseDetails = _businessUnitRepository.GetLicenseDetails(id);
return View(licenseDetails);
}
and here is the test i've written to check if it calls the method in repository.
[TestMethod]
public void ModuleDetails_Action_Calls_GetLicenseDetails()
{
_mockBusinessUnitRepository.GetLicenseDetails(Arg<Guid>.Is.Anything);
_controller.LicenseDetails(Arg<Guid>.Is.Anything);
_mockBusinessUnitRepository.AssertWasCalled(x=>x.GetLicenseDetails(Arg<Guid>.Is.Anything));
}
I'm getting error right now that says: Test method AdminPortal.Tests.Controller_Test.Customer.BusinessUnitControllerTests.ModuleDetails_Action_Calls_GetLicenseDetails threw exception: System.InvalidOperationException: Use Arg ONLY within a mock method call while recording. 1 arguments expected, 3 have been defined.
Ps: I'm using Rhino mock and i'm new to this testing thing