Help, can someone help and explain the purpose of the Rhino Mocks recording area?
I assumed that the expectation set within the scope would only be checked, but it seems that as soon as you create the mockup of the object, Rhino Mocks is in recording mode, so I'm not sure about the purpose of the recording area now.
Here is an example that I have:
private static void SomeTest() { MockRepository mockRepository = new MockRepository(); ISomeInterface test = mockRepository.StrictMock<ISomeInterface>(); test.Bar(); using (mockRepository.Record()) { Expect.Call<string>(test.GetFoo()).Return("Hello"); } using (mockRepository.Playback()) { test.GetFoo(); } } public interface ISomeInterface { string GetFoo(); void Bar(); }
This test will fail because it is expected to call Bar . Is it because I created StrictMock and not Dynamic?
This test will fail because there is no expected call to Bar (), but it has been called.
, , , . DynamicMock, , , . DynamicMocks , , StrictMocks , , .
Record/Replay, , MockRepository. StrictMock, , , , , .
Source: https://habr.com/ru/post/1708943/More articles:Blackberry scripting development? - scriptingDoes anyone use the POCO Adapter for Entity Framework in production? - architecturejavascript Objects / Arrays - How? - javascriptRemote name cannot be resolved - .netFunctional Specifications - specificationshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1708944/python-joining-multiple-lists-to-one-single-sentence&usg=ALkJrhgYuC2mYIl_ZHbJQsrOiymLHNgFEgHow to get cell value from formula in Excel using VBA? - vbaHow to solve the case when users switch to index.php - phpMySQL with two LEFT JOINs in one table - sqlAlpha transparency with particle effects in OpenGL - openglAll Articles