Logger and unit test
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?
Regards,
Vjeko
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | 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
1 Posted by neil on 22 Sep, 2012 10:37 AM
What version of RL are you using?
what are you trying to test? the Logger or the class into which it is injected.
2 Posted by Vj3k0 on 22 Sep, 2012 10:46 AM
I'm using RL2 latest. I'm trying to test my class which has logger instance injected.
Support Staff 3 Posted by Shaun Smith on 22 Sep, 2012 11:01 AM
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 Posted by Vj3k0 on 22 Sep, 2012 05:10 PM
Stubbed it in the end.
Thanks, regards,
Vjeko
Ondina D.F. closed this discussion on 23 Sep, 2012 09:24 AM.