Created
December 20, 2016 02:11
-
-
Save jdunne/8e234a2059d6e968f73da519bf1fcd84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Service | |
{ | |
class NullAuditor : IAuditor | |
{ | |
void RecordThatSomethingWasDone() | |
{ | |
// does nothing | |
} | |
} | |
private readonly IAuditor _nullAuditor = new NullAuditor(); | |
public void DoSomething() | |
{ | |
DoSomething(_nullAuditor); | |
} | |
public void DoSomething(IAuditor auditor) | |
{ | |
// do something… | |
auditor.RecordThatSomethingWasDone(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment