Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added normal constructor pattern

  • Loading branch information...
commit 19de2d789ea2d1a52b20be0cecf1e8915d3a8f1c 1 parent 2a6ab57
@ericnewton76 ericnewton76 authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 README.markdown
View
9 README.markdown
@@ -15,10 +15,17 @@ public class MyComponent
{
readonly IFileSystem fileSystem;
+ // <summary>Create MyComponent with the given fileSystem implementation</summary>
public MyComponent(IFileSystem fileSystem)
{
this.fileSystem = fileSystem;
}
+ /// <summary>Create MyComponent</summary>
+ public MyComponent() : this(
+ fileSystem: new FileSystem() //use default implementation which calls System.IO
+ )
+ {
+ }
public void Validate()
{
@@ -75,4 +82,4 @@ void MyFancyMethod()
var testableFileInfo = (FileInfoBase)SomeBadApiMethodThatReturnsFileInfo();
...
}
-```
+```
Please sign in to comment.
Something went wrong with that request. Please try again.