public void MapNullablePropertyWithRequiredAttributeExectedException()
        {
            var mappedType = TypeMapperFactory.Create().Map <Person>();

            Action action = () => mappedType.Primitives.ForEach(x => { });

            action.Should().Throw <ArgumentException>();
        }
Example #2
0
        public ModelAnnotationsMapper(
            TypeConvention <object, object> typeConvention,
            IKeyConvention keyConvention,
            IVersionConvention versionConvention)
        {
            var conventions =
                new TypeMapperConventions(null, null, null, typeConvention, keyConvention, versionConvention);

            typeMapper =
                TypeMapperFactory.Create(conventions);
        }
Example #3
0
        public void CheckMappingOfAggregate()
        {
            var mappedType =
                TypeMapperFactory.Create().Map <Blog>();

            mappedType.Primitives.Count().Should().Be(1, "Primitives member are retrieved. Expected none.");
            mappedType.References.Count().Should().Be(0, "References member are retrieved. Expected none.");
            var collection = mappedType.Collections.Single();

            collection.Name.Should().Be("PostList");
            collection.Type.Should().Be(typeof(IList <Post>));
        }
Example #4
0
 public ModelAnnotationsMapper(TypeMapperConventions conventions)
 {
     typeMapper =
         TypeMapperFactory.Create(conventions);
 }