public void PopulateThrowsExceptionWithNullStrategyBuildChain() { var executeStrategy = Substitute.For <IExecuteStrategy>(); executeStrategy.BuildChain.Returns((IBuildChain)null !); var sut = new TypeCreatorWrapper(); Action action = () => sut.Populate(executeStrategy, typeof(string)); action.Should().Throw <InvalidOperationException>(); }
public void PopulateThrowsExceptionWithNullType() { var buildChain = new BuildHistory(); var executeStrategy = Substitute.For <IExecuteStrategy>(); executeStrategy.BuildChain.Returns(buildChain); var sut = new TypeCreatorWrapper(); Action action = () => sut.Populate(executeStrategy, null !); action.Should().Throw <ArgumentNullException>(); }
public void PopulateThrowsExceptionWhenPopulateVerificationFails() { var buildChain = new BuildHistory(); var executeStrategy = Substitute.For <IExecuteStrategy>(); executeStrategy.BuildChain.Returns(buildChain); var sut = new TypeCreatorWrapper(); Action action = () => sut.Populate(executeStrategy, false); action.Should().Throw <NotSupportedException>(); }
public void PopulateReturnsProvidedInstance() { var buildChain = new BuildHistory(); var executeStrategy = Substitute.For <IExecuteStrategy>(); executeStrategy.BuildChain.Returns(buildChain); var expected = new List <string>(); var sut = new TypeCreatorWrapper(); var actual = sut.Populate(executeStrategy, expected); actual.Should().BeSameAs(expected); }
public void PopulateDoesNotThrowsExceptionWhenPopulateVerificationPasses() { var buildChain = new BuildHistory(); var executeStrategy = Substitute.For <IExecuteStrategy>(); executeStrategy.BuildChain.Returns(buildChain); var value = new List <string>(); var sut = new TypeCreatorWrapper(); Action action = () => sut.Populate(executeStrategy, value); action.Should().NotThrow(); }
public void PopulateThrowsExceptionWithNullInstanceTest() { var executeStrategy = new DummyExecuteStrategy(); var target = new TypeCreatorWrapper(); Action action = () => target.Populate(null, executeStrategy); action.ShouldThrow<ArgumentNullException>(); }
public void PopulateThrowsExceptionWithNullExecuteStrategyTest() { var person = new Person(); var target = new TypeCreatorWrapper(); Action action = () => target.Populate(person, null); action.ShouldThrow<ArgumentNullException>(); }
public void PopulateThrowsExceptionWhenPopulateVerificationFailsTest() { var executeStrategy = new DummyExecuteStrategy(); var target = new TypeCreatorWrapper(); Action action = () => target.Populate(false, executeStrategy); action.ShouldThrow<NotSupportedException>(); }
public void PopulateDoesNotThrowsExceptionWhenPopulateVerificationPassesTest() { var executeStrategy = new DummyExecuteStrategy(); var value = new List<string>(); var target = new TypeCreatorWrapper(); Action action = () => target.Populate(value, executeStrategy); action.ShouldNotThrow(); }