示例#1
0
        public void MapType()
        {
            // Arrange
            var mapDefinition = new MapDefinition <SampleModel>();

            // Act
            mapDefinition.MapType();

            // Assert
            var fields = mapDefinition.FieldMapDefinitions;

            Assert.Equal(3, fields.Count);
            AssertFieldMap(fields, "Test1", "Test1", true);
            AssertFieldMap(fields, "Test2", "Test2", false);
            AssertFieldMap(fields, "Test3", "Test3", true);
        }
示例#2
0
        public void MapTypeThenOverride()
        {
            // Arrange
            var mapDefinition = new MapDefinition<SampleModel>();

            // Act
            mapDefinition.MapType();
            mapDefinition.Map(model => model.Test2, "Foo", true);
            mapDefinition.Map(model => model.Test3, false);

            // Assert
            var fields = mapDefinition.FieldMapDefinitions;
            Assert.Equal(3, fields.Count);
            AssertFieldMap(fields, "Test1", "Test1", true);
            AssertFieldMap(fields, "Test2", "Foo", true);
            AssertFieldMap(fields, "Test3", "Test3", false);
        }