public void CustomizeNullFixtureThrows() { // Fixture setup var dummy = typeof(object); var sut = new NoAutoPropertiesCustomization(dummy); // Exercise system and verify the outcome Assert.Throws <ArgumentNullException>(() => sut.Customize(null)); }
public void CustomizeNullFixtureThrows() { // Arrange var dummy = typeof(object); var sut = new NoAutoPropertiesCustomization(dummy); // Act & Assert Assert.Throws <ArgumentNullException>(() => sut.Customize(null)); }
public void CustomizeCorrectlyDisablesAutoPropertyPopulationForType() { // Fixture setup var targetType = typeof(PropertyHolder <string>); var fixture = new Fixture(); var sut = new NoAutoPropertiesCustomization(targetType); // Exercise system var fixtureBeforeCustomization = fixture.Create <PropertyHolder <string> >(); sut.Customize(fixture); var fixtureAfterCustomization = fixture.Create <PropertyHolder <string> >(); var secondFixtureAfterCustomization = fixture.Create <PropertyHolder <string> >(); // Verify the outcome Assert.NotNull(fixtureBeforeCustomization.Property); Assert.Null(fixtureAfterCustomization.Property); Assert.Null(secondFixtureAfterCustomization.Property); }
public void CustomizeCorrectlyDisablesAutoPropertyPopulationForType() { // Arrange var targetType = typeof(PropertyHolder <string>); var fixture = new Fixture(); var sut = new NoAutoPropertiesCustomization(targetType); // Act var fixtureBeforeCustomization = fixture.Create <PropertyHolder <string> >(); sut.Customize(fixture); var fixtureAfterCustomization = fixture.Create <PropertyHolder <string> >(); var secondFixtureAfterCustomization = fixture.Create <PropertyHolder <string> >(); // Assert Assert.NotNull(fixtureBeforeCustomization.Property); Assert.Null(fixtureAfterCustomization.Property); Assert.Null(secondFixtureAfterCustomization.Property); }