emma
9/15/2019 - 10:43 AM

Moq

Mock<ISomeInterface> mockThing = new Mock<ISomeInterface>();
// Make all mockable objects automatically create & return a Mock
mockThing.DefaultValue = DefaultValue.Mock;
// Remember changes to a property
mockThing.SetupProperty(x => x.PropertyName);
// Or:
mockThing.SetupAllProperties();

mockThing.Verify(x => x.IsValid(It.IsAny<string>()));

mockThing.VerifySet(c => x.Property = ValidationMode.Detailed);