私は PartialMock として使用している基本クラスを持っています
1 IContextManager contextManager = mocks.StrictMock<IContextManager>();
2 target = mocks.PartialMock<EnumerationServiceBase>(new object[] { contextManager });
3 Expect.Call(delegate { contextManager.RemoveContext(guid); });
4 mocks.ReplayAll();
5 actual = target.ReleaseOp(request);
target.ReleaseOp(request) には、3 行目で期待値を設定した contextManager.RemoveContext メソッドへの呼び出しがありますが、それでも次のエラーが発生します。
Rhino.Mocks.Exceptions.ExpectationViolationException: IContextManager.RemoveContext("e04c757b-8b70-4294-b133-94fd6b52ba04"); 予想 #0、実際の #1。
これは、これが機能しなかった最初のテストです (他の 45 程度は問題ありません) が、A) 部分モック、および B) void を返すモック メソッドを使用した最初のテストでもあります。何か案は?