Esempio n. 1
0
        public void AddWithTypeMappingRuleThrowsExceptionWithNullConfiguration()
        {
            var rule = new TypeMappingRule(typeof(Stream), typeof(MemoryStream));

            Action action = () => BuildConfigurationExtensions.Add(null !, rule);

            action.Should().Throw <ArgumentNullException>();
        }
Esempio n. 2
0
        public void ReturnsConstructorParametersAsProperties()
        {
            var sourceType = typeof(Stream);
            var targetType = typeof(MemoryStream);

            var sut = new TypeMappingRule(sourceType, targetType);

            sut.SourceType.Should().Be(sourceType);
            sut.TargetType.Should().Be(targetType);
        }
Esempio n. 3
0
        public void AddWithTypeMappingRuleAddsRuleToConfiguration()
        {
            var rule = new TypeMappingRule(typeof(Stream), typeof(MemoryStream));

            var sut = new BuildConfiguration();

            var config = sut.Add(rule);

            config.Should().Be(sut);

            sut.TypeMappingRules.Should().Contain(rule);
        }