Beispiel #1
0
 public void ShouldMapDBColumn()
 {
     var mapper = new DBColumnMapper();
     var column = new Column
                      {
                          Name = "Age",
                          DataType = "Int",
                          IsNullable = true
                      };
     Assert.That(mapper.Map(column, "Age", new PascalCaseTextFormatter()), Is.EqualTo("Map(x => x.Age).Column(\"Age\");"));
 }
Beispiel #2
0
 public void ShouldMapDBColumnWithProperties()
 {
     var mapper = new DBColumnMapper();
     var column = new Column
                      {
                          Name = "Name",
                          DataLength = 16,
                          DataType = "varchar",
                          IsForeignKey = false,
                          IsNullable = false,
                          IsPrimaryKey = false,
                          MappedDataType = "string"
                      };
     Assert.That(mapper.Map(column, "Name", new PascalCaseTextFormatter()), Is.EqualTo("Map(x => x.Name).Column(\"Name\").Not.Nullable().Length(16);"));
 }
 public void ShouldMapDBColumnWithProperties()
 {
     var mapper = new DBColumnMapper();
     var columnDetail = new ColumnDetail("Name", "varchar", 16, 0, 0, false);
     Assert.That(mapper.Map(columnDetail), Is.EqualTo("Map(x => x.Name).Length(16).Not.Nullable();"));
 }
 public void ShouldMapDBColumn()
 {
     var mapper = new DBColumnMapper();
     var columnDetail = new ColumnDetail("Age", "Int", 0, 0, 0, true);
     Assert.That(mapper.Map(columnDetail), Is.EqualTo("Map(x => x.Age);"));
 }