Inheritance: DefaultExecuteStrategy
コード例 #1
0
        public void CreateThrowsExceptionWhenDerivedImplementationSuppliesNullType()
        {
            var buildConfiguration = Substitute.For <IBuildConfiguration>();

            var sut = new NullTypeBuildExecuteStrategy();

            sut.Initialize(buildConfiguration);

            Action action = () => sut.Create(typeof(int));

            action.Should().Throw <ArgumentNullException>();
        }
コード例 #2
0
        public void CreateWithThrowsExceptionWhenDerivedImplementationSuppliesNullTypeTest()
        {
            var buildLog = new DefaultBuildLog();

            var buildStrategy = Substitute.For<IBuildStrategy>();

            buildStrategy.GetBuildLog().Returns(buildLog);

            var target = new NullTypeBuildExecuteStrategy();

            target.Initialize(buildStrategy, buildStrategy.GetBuildLog());

            Action action = () => target.CreateWith(typeof(int));

            action.ShouldThrow<ArgumentNullException>();
        }