public AddColumn ( |
||
mapping | ||
return | void |
public void ShouldWriteColumns() { var mapping = new PropertyMapping(); mapping.AddColumn(new ColumnMapping { Name = "Column1" }); writer.VerifyXml(mapping) .Element("column").Exists(); }
public void CollectionContainsWithStringShouldBeFalseWhenNoItemsMatching() { acceptance .Expect(x => x.Columns.Contains("boo")); var mapping = new PropertyMapping(); mapping.AddColumn(new ColumnMapping { Name = "Column1" }); acceptance .Matches(new PropertyInspector(mapping)) .ShouldBeFalse(); }
public void CollectionIsNotEmptyShouldBeTrueWithItemsWhenUsingExpression() { acceptance .Expect(x => x.Columns.IsNotEmpty()); var mapping = new PropertyMapping(); mapping.AddColumn(new ColumnMapping { Name = "Column1" }); acceptance .Matches(new PropertyInspector(mapping)) .ShouldBeTrue(); }
public void CollectionIsEmptyShouldBeFalseWithItemsWhenUsingExpression() { acceptance .Expect(x => x.Columns.IsEmpty()); var mapping = new PropertyMapping(); mapping.AddColumn(Layer.Defaults, new ColumnMapping("Column1")); acceptance .Matches(new PropertyInspector(mapping)) .ShouldBeFalse(); }
public void CollectionContainsWithLambdaShouldBeTrueWhenItemsMatching() { acceptance .Expect(x => x.Columns.Contains(c => c.Name == "Column1")); var mapping = new PropertyMapping(); mapping.AddColumn(new ColumnMapping { Name = "Column1" }); acceptance .Matches(new PropertyInspector(mapping)) .ShouldBeTrue(); }
private PropertyMapping GetPropertyMapping(Type type, Member property) { var mapping = new PropertyMapping { ContainingEntityType = type, Member = property }; var columnMapping = new ColumnMapping(); columnMapping.Set(x => x.Name, Layer.Defaults, property.Name); mapping.AddColumn(Layer.Defaults, columnMapping); mapping.Set(x => x.Name, Layer.Defaults, mapping.Member.Name); mapping.Set(x => x.Type, Layer.Defaults, GetDefaultType(property)); SetDefaultAccess(property, mapping); return mapping; }
public void CollectionContainsWithLambdaShouldBeFalseWhenNoItemsMatching() { acceptance .Expect(x => x.Columns.Contains(c => c.Name == "boo")); var mapping = new PropertyMapping(); mapping.AddColumn(Layer.Defaults, new ColumnMapping("Column1")); acceptance .Matches(new PropertyInspector(mapping)) .ShouldBeFalse(); }
public void CollectionContainsWithStringShouldBeTrueWhenItemsMatching() { acceptance .Expect(x => x.Columns.Contains("Column1")); var mapping = new PropertyMapping(); mapping.AddColumn(Layer.Defaults, new ColumnMapping("Column1")); acceptance .Matches(new PropertyInspector(mapping)) .ShouldBeTrue(); }
protected PropertyMapping property_with_column(string column) { var property = new PropertyMapping(); property.AddColumn(Layer.Defaults, new ColumnMapping("propertyColumn")); return property; }
public void ShouldWriteColumns() { var mapping = new PropertyMapping(); mapping.AddColumn(Layer.Defaults, new ColumnMapping("Column1")); writer.VerifyXml(mapping) .Element("column").Exists(); }