public void AfterSetMultiColumnsCantSetSimpleColumn() { var mapping = new HbmElement(); var mapper = new ElementMapper(typeof(string), mapping); mapper.Columns(cm => cm.Length(50), cm => cm.SqlType("VARCHAR(10)")); ActionAssert.Throws<ConfOrm.MappingException>(() => mapper.Column(cm => cm.Length(50))); }
public void AfterSetMultiColumnsCantSetSimpleColumn() { var mapping = new HbmElement(); var mapper = new ElementMapper(typeof(string), mapping); mapper.Columns(cm => cm.Length(50), cm => cm.SqlType("VARCHAR(10)")); ActionAssert.Throws <ConfOrm.MappingException>(() => mapper.Column(cm => cm.Length(50))); }
public void AfterSetMultiColumnsCantSetSimpleColumn() { var mapping = new HbmElement(); var mapper = new ElementMapper(typeof(string), mapping); mapper.Columns(cm => cm.Length(50), cm => cm.SqlType("VARCHAR(10)")); Executing.This(() => mapper.Column(cm => cm.Length(50))).Should().Throw <MappingException>(); }
public void WhenSetMultiColumnsValuesThenAutoassignColumnNames() { var mapping = new HbmElement(); var mapper = new ElementMapper(typeof(string), mapping); mapper.Columns(cm => cm.Length(50), cm => cm.SqlType("VARCHAR(10)")); mapping.Columns.Should().Have.Count.EqualTo(2); mapping.Columns.All(cm => cm.name.Satisfy(n => !string.IsNullOrEmpty(n))); }
public void WhenSetMultiColumnsValuesThenAddColumns() { var mapping = new HbmElement(); var mapper = new ElementMapper(typeof(string), mapping); mapper.Type <MyType>(); mapper.Columns(cm => { cm.Name("column1"); cm.Length(50); }, cm => { cm.Name("column2"); cm.SqlType("VARCHAR(10)"); }); mapping.Columns.Should().Have.Count.EqualTo(2); }
public void WhenSetMultiColumnsValuesThenAutoassignColumnNames() { var mapping = new HbmElement(); var mapper = new ElementMapper(typeof(string), mapping); mapper.Columns(cm => cm.Length(50), cm => cm.SqlType("VARCHAR(10)")); mapping.Columns.Should().Have.Count.EqualTo(2); mapping.Columns.All(cm => cm.name.Satisfy(n => !string.IsNullOrEmpty(n))); }
public void WhenSetMultiColumnsValuesThenAddColumns() { var mapping = new HbmElement(); var mapper = new ElementMapper(typeof(string), mapping); mapper.Type<MyType>(); mapper.Columns(cm => { cm.Name("column1"); cm.Length(50); }, cm => { cm.Name("column2"); cm.SqlType("VARCHAR(10)"); }); mapping.Columns.Should().Have.Count.EqualTo(2); }