Created
August 3, 2011 23:57
-
-
Save SimonCropp/1124188 to your computer and use it in GitHub Desktop.
NSubstitute and avoiding calling the constructor
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 Program | |
{ | |
static void Main(string[] args) | |
{ | |
var person = Substitute.For<Person>(); | |
person.Name = "sdsdf"; | |
Console.WriteLine(person.Name); | |
} | |
} | |
public class Person | |
{ | |
public string Name { get; set; } | |
public Person(string name) | |
{ | |
Name = name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment