I have some code that worked in version 2.2 but its not working in 2.3.
The code is:
Mock mockDatabase = MockManager.Mock(typeof(Database));
mockDatabase.ExpectUnmockedCall("Get");
When the operation runs while mocked, I get an Object null reference when calling "Get" on Database.
Hi,
This is probrably a bug :twisted:, the code should work, we will check it, fix it and post the fix (Read on to see a workaround)
I need to mock another method besides "Get", so that is why I need to mock this object and let "Get" run as an unmocked call.
From what I understand you don't really need to use ExpectUnmockedCall, if you are mocking other methods and you are not in Strict mode, all non registered expectations are unmocked.
The only times that you should use Unmocked is:
1. You are in Strict Mode.
2. You want to Mock a Method AFTER it runs normally 1 or more times.
3. You want to verify the arguments passed.
4. You are using a Dynamic Mock of an Interface (This is because there is no real code in the class created that implements the Interface)
:?: Does your test work if you remove the expecatation?