public void SetsConfigureMembersPropertyToTrue() { // Arrange var sut = new AutoConfiguredMoqCustomization(); // Act & Assert Assert.True(sut.ConfigureMembers); }
public void IsInheritedFromAutoMoqCustomization() { // Arrange var sut = new AutoConfiguredMoqCustomization(); // Act & Assert Assert.IsAssignableFrom <AutoMoqCustomization>(sut); }
public void CustomizeThrowsWhenFixtureIsNull() { // Arrange var sut = new AutoConfiguredMoqCustomization(); // Act & Assert Assert.Throws <ArgumentNullException>( () => sut.Customize(null)); }
public void CustomizeThrowsWhenFixtureIsNull() { // Fixture setup var sut = new AutoConfiguredMoqCustomization(); // Exercise system and verify outcome Assert.Throws<ArgumentNullException>( () => sut.Customize(null)); // Teardown }
public void RelayIsMockRelayByDefault() { // Fixture setup var sut = new AutoConfiguredMoqCustomization(); // Exercise system var relay = sut.Relay; // Verify outcome Assert.IsType<MockRelay>(relay); // Teardown }
public void RelayIsMockRelayByDefault() { // Arrange var sut = new AutoConfiguredMoqCustomization(); // Act var relay = sut.Relay; // Assert Assert.IsType <MockRelay>(relay); }
public void CustomizeThrowsWhenFixtureIsNull() { // Fixture setup var sut = new AutoConfiguredMoqCustomization(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>( () => sut.Customize(null)); // Teardown }
public void RelayIsMockRelayByDefault() { // Fixture setup var sut = new AutoConfiguredMoqCustomization(); // Exercise system var relay = sut.Relay; // Verify outcome Assert.IsType <MockRelay>(relay); // Teardown }
public void CustomizeAddsPostprocessorToCustomizations() { // Fixture setup var customizations = new List<ISpecimenBuilder>(); var fixture = new Mock<IFixture> {DefaultValue = DefaultValue.Mock}; fixture.Setup(f => f.Customizations) .Returns(customizations); var sut = new AutoConfiguredMoqCustomization(); // Exercise system sut.Customize(fixture.Object); // Verify outcome Assert.True(customizations.Any(builder => builder is Postprocessor)); // Teardown }
public void CustomizeAddsPostprocessorToCustomizations() { // Arrange var customizations = new List <ISpecimenBuilder>(); var fixture = new Mock <IFixture> { DefaultValue = DefaultValue.Mock }; fixture.Setup(f => f.Customizations) .Returns(customizations); var sut = new AutoConfiguredMoqCustomization(); // Act sut.Customize(fixture.Object); // Assert Assert.Contains(customizations, builder => builder is Postprocessor); }
public void CustomizeAddsMockCommandsToPostprocessor(Type expectedCommandType) { // Fixture setup var customizations = new List<ISpecimenBuilder>(); var fixture = new Mock<IFixture> {DefaultValue = DefaultValue.Mock}; fixture.Setup(f => f.Customizations) .Returns(customizations); var sut = new AutoConfiguredMoqCustomization(); // Exercise system sut.Customize(fixture.Object); // Verify outcome var postprocessor = (Postprocessor) customizations.Single(builder => builder is Postprocessor); var compositeCommand = (CompositeSpecimenCommand) postprocessor.Command; Assert.True(compositeCommand.Commands.Any(command => command.GetType() == expectedCommandType)); // Teardown }
public void CustomizeAddsPostprocessorToCustomizations() { // Fixture setup var customizations = new List <ISpecimenBuilder>(); var fixture = new Mock <IFixture> { DefaultValue = DefaultValue.Mock }; fixture.Setup(f => f.Customizations) .Returns(customizations); var sut = new AutoConfiguredMoqCustomization(); // Exercise system sut.Customize(fixture.Object); // Verify outcome Assert.True(customizations.Any(builder => builder is Postprocessor)); // Teardown }
public void CustomizeAddsRelayToResidueCollectors() { // Arrange var relay = new Mock <ISpecimenBuilder>(); var collectors = new List <ISpecimenBuilder>(); var fixture = new Mock <IFixture> { DefaultValue = DefaultValue.Mock }; fixture.Setup(f => f.ResidueCollectors) .Returns(collectors); var sut = new AutoConfiguredMoqCustomization(relay.Object); // Act sut.Customize(fixture.Object); // Assert Assert.Contains(relay.Object, collectors); }
public void CustomizeAddsRelayToResidueCollectors() { // Fixture setup var relay = new Mock <ISpecimenBuilder>(); var collectors = new List <ISpecimenBuilder>(); var fixture = new Mock <IFixture> { DefaultValue = DefaultValue.Mock }; fixture.Setup(f => f.ResidueCollectors) .Returns(collectors); var sut = new AutoConfiguredMoqCustomization(relay.Object); // Exercise system sut.Customize(fixture.Object); // Verify outcome Assert.Contains(relay.Object, collectors); // Teardown }
public void CustomizeAddsMockCommandsToPostprocessor(Type expectedCommandType) { // Arrange var customizations = new List <ISpecimenBuilder>(); var fixture = new Mock <IFixture> { DefaultValue = DefaultValue.Mock }; fixture.Setup(f => f.Customizations) .Returns(customizations); var sut = new AutoConfiguredMoqCustomization(); // Act sut.Customize(fixture.Object); // Assert var postprocessor = (Postprocessor)customizations.Single(builder => builder is Postprocessor); var compositeCommand = (CompositeSpecimenCommand)postprocessor.Command; Assert.Contains(compositeCommand.Commands, command => command.GetType() == expectedCommandType); }
public void CustomizeAddsMockCommandsToPostprocessor(Type expectedCommandType) { // Fixture setup var customizations = new List <ISpecimenBuilder>(); var fixture = new Mock <IFixture> { DefaultValue = DefaultValue.Mock }; fixture.Setup(f => f.Customizations) .Returns(customizations); var sut = new AutoConfiguredMoqCustomization(); // Exercise system sut.Customize(fixture.Object); // Verify outcome var postprocessor = (Postprocessor)customizations.Single(builder => builder is Postprocessor); var compositeCommand = (CompositeSpecimenCommand)postprocessor.Command; Assert.True(compositeCommand.Commands.Any(command => command.GetType() == expectedCommandType)); // Teardown }
public void CustomizeAddsRelayToResidueCollectors() { // Fixture setup var relay = new Mock<ISpecimenBuilder>(); var collectors = new List<ISpecimenBuilder>(); var fixture = new Mock<IFixture> {DefaultValue = DefaultValue.Mock}; fixture.Setup(f => f.ResidueCollectors) .Returns(collectors); var sut = new AutoConfiguredMoqCustomization(relay.Object); // Exercise system sut.Customize(fixture.Object); // Verify outcome Assert.Contains(relay.Object, collectors); // Teardown }