Skip to content

Instantly share code, notes, and snippets.

@SimonCropp
Created August 3, 2011 23:57
Show Gist options
  • Save SimonCropp/1124188 to your computer and use it in GitHub Desktop.
Save SimonCropp/1124188 to your computer and use it in GitHub Desktop.
NSubstitute and avoiding calling the constructor
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