Logger and unit test

Vj3k0's Avatar


22 Sep, 2012 08:13 AM

I'm injecting instance of Logger to one class, and I want to unit test it. I have to manually satisfy injections so my question is how would one do it for Logger?


  1. 1 Posted by neil on 22 Sep, 2012 10:37 AM

    neil's Avatar

    What version of RL are you using?
    what are you trying to test? the Logger or the class into which it is injected.

  2. 2 Posted by Vj3k0 on 22 Sep, 2012 10:46 AM

    Vj3k0's Avatar

    I'm using RL2 latest. I'm trying to test my class which has logger instance injected.

  3. Support Staff 3 Posted by Shaun Smith on 22 Sep, 2012 11:01 AM

    Shaun Smith's Avatar

    Unless you are wanting to test the logging itself, the best thing to do would be to inject a stub - just a blank implementation of ILogger with methods that do nothing.

  4. 4 Posted by Vj3k0 on 22 Sep, 2012 05:10 PM

    Vj3k0's Avatar

    Stubbed it in the end.

    Thanks, regards,

  5. Ondina D.F. closed this discussion on 23 Sep, 2012 09:24 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac