If a class is not mocked, it will be called directly (not intercepted). If it is called and not intercepted, then code coverage tools would see that it was executed and report a "non-zero" code coverage - simply meaning your code was executed.
On Wed, Sep 8, 2010 at 9:28 AM, Benjie Fallar III <bfall...@gmail.com>wrote: > Yes, my actual classes does not report code coverage. So using Rhino.Mocks > really does not generate code coverage in VS 2008 because it's "mocking" the > interfaces. What do you mean by "*but the classes not mocked but > interacting with the mocks should show non-zero code coverage*"? But my > normal classes using standard unit test project generates code coverage. > > On Wed, Sep 8, 2010 at 8:41 PM, Stephen Bohlen <sboh...@gmail.com> wrote: > >> Do you mean "code coverage for the Rhino.Mocks codebase" or do you mean >> "code coverage for your own code-under-test when writing tests with >> Rhino.Mocks" ? And by "no code coverage" do you mean you're having problems >> getting the VS2008 Code coverage report or you get the report but it shows >> zero coverage? >> >> One thing to pay attention to is that you will (typically) see very low >> (if even non-zero) code-coverage for classes that you are MOCKING because >> (of course) those classes aren't actually in play during your tests (e.g., >> if they are mocked, their code isn't actually being tested and so their >> coverage will typically be zero). >> >> But the classes not mocked but interacting with the mocks should show >> non-zero coverage numbers. Rhino.Mocks shouldn't in any way interfere with >> the VS2008 code coverage tools generating their reports. Can you try to >> write a test in a completely new project/solution to ensure that you are >> able to get a code coverage report out of VS2008 when Rhino.Mocks isn't >> involved in the test-run? >> >> Steve Bohlen >> sboh...@gmail.com >> http://blog.unhandled-exceptions.com >> http://twitter.com/sbohlen >> >> >> >> On Wed, Sep 8, 2010 at 8:06 AM, Tim Barcz <timba...@gmail.com> wrote: >> >>> Ben, >>> >>> I don't understand what you mean.. please explain and/or provide a >>> screenshot. >>> >>> Tim >>> >>> On Sep 8, 2010, at 2:14 AM, Benjamin <bfall...@gmail.com> wrote: >>> >>> > Why is there no code coverage when using Rhino.Mocks 3.6 in VS 2008 >>> > even though the testrunconfig enabled the code coverage already for >>> > the target assemblies? >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups "Rhino.Mocks" group. >>> > To post to this group, send email to rhinomo...@googlegroups.com. >>> > To unsubscribe from this group, send email to >>> rhinomocks+unsubscr...@googlegroups.com<rhinomocks%2bunsubscr...@googlegroups.com> >>> . >>> > For more options, visit this group at >>> http://groups.google.com/group/rhinomocks?hl=en. >>> > >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Rhino.Mocks" group. >>> To post to this group, send email to rhinomo...@googlegroups.com. >>> To unsubscribe from this group, send email to >>> rhinomocks+unsubscr...@googlegroups.com<rhinomocks%2bunsubscr...@googlegroups.com> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/rhinomocks?hl=en. >>> >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Rhino.Mocks" group. >> To post to this group, send email to rhinomo...@googlegroups.com. >> To unsubscribe from this group, send email to >> rhinomocks+unsubscr...@googlegroups.com<rhinomocks%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/rhinomocks?hl=en. >> > > > > -- > > Regards, > > Benjamin P Fallar III > http://twitter.com/bfallar3 > > -- > You received this message because you are subscribed to the Google Groups > "Rhino.Mocks" group. > To post to this group, send email to rhinomo...@googlegroups.com. > To unsubscribe from this group, send email to > rhinomocks+unsubscr...@googlegroups.com<rhinomocks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rhinomocks?hl=en. > -- Tim Barcz Microsoft C# MVP Microsoft ASPInsider http://timbarcz.devlicio.us http://www.twitter.com/timbarcz -- You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to rhinomo...@googlegroups.com. To unsubscribe from this group, send email to rhinomocks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en.