public void MapNullablePropertyWithRequiredAttributeExectedException() { var mappedType = TypeMapperFactory.Create().Map <Person>(); Action action = () => mappedType.Primitives.ForEach(x => { }); action.Should().Throw <ArgumentException>(); }
public ModelAnnotationsMapper( TypeConvention <object, object> typeConvention, IKeyConvention keyConvention, IVersionConvention versionConvention) { var conventions = new TypeMapperConventions(null, null, null, typeConvention, keyConvention, versionConvention); typeMapper = TypeMapperFactory.Create(conventions); }
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>)); }
public ModelAnnotationsMapper(TypeMapperConventions conventions) { typeMapper = TypeMapperFactory.Create(conventions); }