Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Last active August 3, 2017 05:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HamidMosalla/a1524017155cdd5fba594b1daea4417c to your computer and use it in GitHub Desktop.
Save HamidMosalla/a1524017155cdd5fba594b1daea4417c to your computer and use it in GitHub Desktop.
[Fact]
public void TrackAllPropertiesWithSetupAllProperties()
{
var mock = new Mock<IPropertyManager>();
//mock.SetupProperty(m => m.FirstName);
//Comment this and uncomment SetupProperty, the assertion fails
mock.SetupAllProperties();
mock.Object.FirstName = "Robert";
mock.Object.LastName = "Paulson";
mock.Object.FirstName.Should().Be("Robert");
mock.Object.LastName.Should().Be("Paulson");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment