Esempio n. 1
0
        public void ResolveBuildTypeThrowsExceptionWithNullConfiguration()
        {
            var sut = new ResolveBuildTypeWrapper();

            Action action = () => sut.RunResolveBuildType(typeof(Stream), null !);

            action.Should().Throw <ArgumentNullException>();
        }
Esempio n. 2
0
        public void ResolveBuildTypeThrowsExceptionWithNullRequestedType()
        {
            var configuration = Substitute.For <IBuildConfiguration>();

            var sut = new ResolveBuildTypeWrapper();

            Action action = () => sut.RunResolveBuildType(null !, configuration);

            action.Should().Throw <ArgumentNullException>();
        }
Esempio n. 3
0
        public void ResolveBuildTypeReturnsValueFromTypeResolver()
        {
            var requestedType = typeof(IEnumerable <string>);
            var expected      = typeof(List <string>);

            var typeResolver    = Substitute.For <ITypeResolver>();
            var configuration   = Substitute.For <IBuildConfiguration>();
            var executeStrategy = Substitute.For <IExecuteStrategy>();

            configuration.TypeResolver.Returns(typeResolver);
            typeResolver.GetBuildType(configuration, requestedType).Returns(expected);
            executeStrategy.Configuration.Returns(configuration);

            var sut = new ResolveBuildTypeWrapper();

            var actual = sut.RunResolveBuildType(requestedType, configuration);

            actual.Should().Be(expected);
        }