public void MapBuilder_ShouldMapPublicAndPrivateProperties()
        {
            var mapBuilder = new MapBuilder(false);
            var maps       = mapBuilder.BuildColumns <UnmappedPerson>();

            Assert.IsTrue(maps.Count == 7);
        }
Esempio n. 2
0
 public void MapBuilder_ShouldMapPublicProperties_ThatAreSpecified()
 {
     var mapBuilder = new MapBuilder();
     var maps = mapBuilder.BuildColumns<UnmappedPerson>("Name");
     Assert.IsTrue(maps.Count == 1);
     Assert.IsNotNull(maps["Name"]);
 }
        public void MapBuilder_ShouldMapPublicProperties()
        {
            var mapBuilder = new MapBuilder();
            var maps       = mapBuilder.BuildColumns <UnmappedPerson>();

            Assert.IsTrue(maps.Count == 6);
        }
Esempio n. 4
0
 public void MapBuilder_ShouldMapPublicAndPrivateProperties()
 {
     var mapBuilder = new MapBuilder(false);
     var maps = mapBuilder.BuildColumns<UnmappedPerson>();
     Assert.IsTrue(maps.MappedColumns.Count == 6);
     Assert.IsTrue(_mapRepository.Columns[_personType].Count == 6);
 }
        public void MapBuilder_ShouldMapPublicProperties_ThatAreSpecified()
        {
            var mapBuilder = new MapBuilder();
            var maps       = mapBuilder.BuildColumns <UnmappedPerson>("Name");

            Assert.IsTrue(maps.MappedColumns.Count == 1);
            Assert.IsNotNull(maps.MappedColumns.GetByColumnName("Name"));
        }
        public void MapBuilder_ShouldMapPublicAndPrivateProperties()
        {
            var mapBuilder = new MapBuilder(false);
            var maps       = mapBuilder.BuildColumns <UnmappedPerson>();

            Assert.IsTrue(maps.MappedColumns.Count == 6);
            Assert.IsTrue(_mapRepository.Columns[_personType].Count == 6);
        }
Esempio n. 7
0
 public void MapBuilder_ShouldMapPublicProperties_ThatAreOfTypeDateTime()
 {
     var mapBuilder = new MapBuilder();
     var maps = mapBuilder.BuildColumns<UnmappedPerson>(m => 
         m.MemberType == MemberTypes.Property && (m as PropertyInfo).PropertyType == typeof(DateTime));
     
     Assert.IsTrue(maps.Count == 1);
     Assert.IsTrue(maps[0].FieldType == typeof(DateTime));
 }
        public void MapBuilder_ShouldSuffixAltNames_But_ShouldNotSuffixNames()
        {
            var mapBuilder = new MapBuilder();
            var columns    = mapBuilder.BuildColumns <Person>()
                             .MappedColumns.SuffixAltNames("_p");

            Assert.IsTrue(columns.All(c => c.ColumnInfo.AltName.EndsWith("_p")));
            Assert.IsFalse(columns.All(c => c.ColumnInfo.Name.EndsWith("_p")));
        }
        public void MapBuilder_ShouldMapPublicProperties_ThatAreOfTypeDateTime()
        {
            var mapBuilder = new MapBuilder();
            var maps       = mapBuilder.BuildColumns <UnmappedPerson>(m =>
                                                                      m.MemberType == MemberTypes.Property && (m as PropertyInfo).PropertyType == typeof(DateTime));

            Assert.IsTrue(maps.MappedColumns.Count == 1);
            Assert.IsTrue(maps.MappedColumns[0].FieldType == typeof(DateTime));
        }
        public void InitMappings()
        {
            MapBuilder builder = new MapBuilder();

            builder.BuildTable <Person>("PersonTable");

            builder.BuildColumnsFromSimpleTypes <Person>()
            .For(p => p.ID)
            .SetPrimaryKey()
            .SetReturnValue()
            .SetAutoIncrement();

            builder.BuildRelationships <Person>();

            builder.BuildColumns <Pet>()
            .For(p => p.ID)
            .SetPrimaryKey()
            .SetAltName("Pet_ID")
            .For(p => p.Name)
            .SetAltName("Pet_Name");
        }
Esempio n. 11
0
        public void InitMappings()
        {
            MapBuilder builder = new MapBuilder();

            builder.BuildTable<Person>("PersonTable");

            builder.BuildColumnsFromSimpleTypes<Person>()
                .For(p => p.ID)
                    .SetPrimaryKey()
                    .SetReturnValue()
                    .SetAutoIncrement();

            builder.BuildRelationships<Person>();

            builder.BuildColumns<Pet>()
                .For(p => p.ID)
                    .SetPrimaryKey()
                    .SetAltName("Pet_ID")
                .For(p => p.Name)
                    .SetAltName("Pet_Name");
        }
Esempio n. 12
0
 public void MapBuilder_ShouldMapPublicAndPrivateProperties()
 {
     var mapBuilder = new MapBuilder(false);
     var maps = mapBuilder.BuildColumns<UnmappedPerson>();
     Assert.IsTrue(maps.Count == 7);
 }
Esempio n. 13
0
 public void MapBuilder_ShouldMapPublicProperties()
 {
     var mapBuilder = new MapBuilder();
     var maps = mapBuilder.BuildColumns<UnmappedPerson>();
     Assert.IsTrue(maps.Count == 6);
 }
Esempio n. 14
0
        public void MapBuilder_ShouldSuffixAltNames_But_ShouldNotSuffixNames()
        {
            var mapBuilder = new MapBuilder();
            var columns = mapBuilder.BuildColumns<Person>()
                .MappedColumns.SuffixAltNames("_p");

            Assert.IsTrue(columns.All(c => c.ColumnInfo.AltName.EndsWith("_p")));
            Assert.IsFalse(columns.All(c => c.ColumnInfo.Name.EndsWith("_p")));
        }