public void TestStringMappingSet()
 {
     var mapping = new ColumnPropertyMapping<TestUser, string>("UserName", model => model.Name);
     var user = new TestUser();
     mapping.SetValue(user, "Pelle");
     Assert.Equal("Pelle", user.Name);
 }
        public void AutoToStringConversion()
        {
            var mapping = new ColumnPropertyMapping<TestUser, string>("UserName", model => model.Name);
            var user = new TestUser();

            var ctx = new ValueContext<TestUser> {ColumnValue = 22, Entity = user};
            var value = mapping.ConvertValue(ctx);
            Assert.Equal("22", value);
            mapping.SetValue(user, value);
        }
 public void InvalidMapping()
 {
     var mapping = new ColumnPropertyMapping<TestUser, DateTime>("CreatedAt", model => model.CreatedAt);
     var user = new TestUser();
     Assert.Throws<MappingException>(() => mapping.SetValue(user, 22));
 }