Hello,
we have the following Problem:
We are using the latest version of JustMock. We have a large set of unit- and integrationtests (about 2000 tests). We are running the tests using nunit. Sometimes in our test we have to use real instances of some classes and sometimes mocks of these classes. So to get this work we used the Mock.Initialize<Class>() Method in our test.
In my Example, all tests are green, but when we use the initialization, the runtime of the all test-methods rise from 1.2sec to 25sec. We use a lot of instances in the tests (about 200). The problem is, that the runtime for each testmethod rises from test to test.
In our real test the runtime for one test rises from 30 seconds to 25 minuts. This is an inaccettabile fact.
Is this a known issue for you? Are there any workarounds except not using the Initialize method?
I have included two screenshots from nunit.
Example: Calling the same test-method for 25 times. You can the runtime rising for each method:
(26 tests), [0:25.530] Success JustMockExampleTest (26 tests), [0:25.530] Success PersonManagerTestWithInit (26 tests), [0:25.530] Success _00EditPerson_WhyInitialize_ExpectedBehavior, [0:00.418] Success _01EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.613] Success _02EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.602] Success _03EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.638] Success _04EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.672] Success _05EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.714] Success _06EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.743] Success _07EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.783] Success _08EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.822] Success _09EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.855] Success _10EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.891] Success _11EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.922] Success _12EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.962] Success _13EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.994] Success _14EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.029] Success _15EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.061] Success _16EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.100] Success _17EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.139] Success _18EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.167] Success _19EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.206] Success _20EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.252] Success _21EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.272] Success _22EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.269] Success _23EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.276] Success _24EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.290] Success _25EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.299] Success
Thank you very much.
Christian
we have the following Problem:
We are using the latest version of JustMock. We have a large set of unit- and integrationtests (about 2000 tests). We are running the tests using nunit. Sometimes in our test we have to use real instances of some classes and sometimes mocks of these classes. So to get this work we used the Mock.Initialize<Class>() Method in our test.
In my Example, all tests are green, but when we use the initialization, the runtime of the all test-methods rise from 1.2sec to 25sec. We use a lot of instances in the tests (about 200). The problem is, that the runtime for each testmethod rises from test to test.
In our real test the runtime for one test rises from 30 seconds to 25 minuts. This is an inaccettabile fact.
Is this a known issue for you? Are there any workarounds except not using the Initialize method?
I have included two screenshots from nunit.
Example: Calling the same test-method for 25 times. You can the runtime rising for each method:
(26 tests), [0:25.530] Success JustMockExampleTest (26 tests), [0:25.530] Success PersonManagerTestWithInit (26 tests), [0:25.530] Success _00EditPerson_WhyInitialize_ExpectedBehavior, [0:00.418] Success _01EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.613] Success _02EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.602] Success _03EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.638] Success _04EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.672] Success _05EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.714] Success _06EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.743] Success _07EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.783] Success _08EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.822] Success _09EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.855] Success _10EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.891] Success _11EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.922] Success _12EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.962] Success _13EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:00.994] Success _14EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.029] Success _15EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.061] Success _16EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.100] Success _17EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.139] Success _18EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.167] Success _19EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.206] Success _20EditPerson_Creating_LotsOfPersons_ExpectedBehavior, [0:01.252] Success _21EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.272] Success _22EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.269] Success _23EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.276] Success _24EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.290] Success _25EditPerson_Creating_LotsOfPersonsOnlyArrange_ExpectedBehavior, [0:01.299] Success
Thank you very much.
Christian