Example #1
0
        public void PropertyMap_Column_Sets_ColumnName_But_Does_Not_Change_Name()
        {
            Expression <Func <Foo, object> > expression = f => f.Baz;
            var pi = ReflectionHelper.GetProperty(expression) as PropertyInfo;
            var pm = new PropertyMap(pi);

            pm.Column("X");
            Assert.Equal("Baz", pm.Name);
            Assert.Equal("X", pm.ColumnName);
        }
Example #2
0
        public void PropertyMap_Key_Sets_KeyType()
        {
            Expression <Func <Foo, object> > expression = f => f.Baz;
            var pi = ReflectionHelper.GetProperty(expression) as PropertyInfo;
            var pm = new PropertyMap(pi);

            pm.Column("X").Key(KeyType.Identity);
            Assert.Equal("Baz", pm.Name);
            Assert.Equal("X", pm.ColumnName);
            Assert.Equal(KeyType.Identity, pm.KeyType);
        }
Example #3
0
        public void PropertyMap_Column_Sets_ColumnName_But_Does_Not_Change_Name()
        {
            Expression <Func <Foo, object> > expression = f => f.Baz;
            var pi = ReflectionUtils.GetProperty(expression) as PropertyInfo;
            var pm = new PropertyMap(pi);

            pm.Column("X");

            //pm.Name.ShouldBe("Baz");
            //pm.ColumnName.ShouldBe("X");
        }
Example #4
0
        public void PropertyMap_Key_Sets_KeyType()
        {
            Expression <Func <Foo, object> > expression = f => f.Baz;
            var pi = ReflectionUtils.GetProperty(expression) as PropertyInfo;
            var pm = new PropertyMap(pi);

            pm.Column("X").Key(KeyType.Identity);

            //pm.Name.ShouldBe("Baz");
            //pm.ColumnName.ShouldBe("X");
            //pm.KeyType.ShouldBe(KeyType.Identity);
        }
Example #5
0
 public IdOptions Column(string columnName)
 {
     _property.Column(columnName);
     return(this);
 }