public void MapBuilder_ShouldMapPublicAndPrivateProperties() { var mapBuilder = new MapBuilder(false); var maps = mapBuilder.BuildColumns <UnmappedPerson>(); Assert.IsTrue(maps.Count == 7); }
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); }
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); }
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"); }
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"); }
public void MapBuilder_ShouldMapPublicAndPrivateProperties() { var mapBuilder = new MapBuilder(false); var maps = mapBuilder.BuildColumns<UnmappedPerson>(); Assert.IsTrue(maps.Count == 7); }
public void MapBuilder_ShouldMapPublicProperties() { var mapBuilder = new MapBuilder(); var maps = mapBuilder.BuildColumns<UnmappedPerson>(); Assert.IsTrue(maps.Count == 6); }
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"))); }