public void ColumnPropertyMapObjectPropertyTest()
 {
     var expected = _property.PropertyType;
     var propertyMap = new ColumnPropertyMap(_property);
     var actual = propertyMap.ObjectPropertyType;
     Assert.AreEqual(expected, actual);
 }
        public void ColumnPropertyMapGetMethodTest2()
        {
            var expected = new Random().Next(1000000);
            var testObject = new TestObject() { Id = expected };
            var propertyMap = new ColumnPropertyMap(_property);
            var getMethod = propertyMap.GetMethod;
            var actual = getMethod.Invoke(testObject);

            Assert.AreEqual(expected, actual);
        }
        public void ColumnPropertyMapColumnNameTest()
        {
            var columnName = string.Empty;
            var attributes = _property.GetCustomAttributes(typeof(System.Data.Linq.Mapping.ColumnAttribute));

            if (attributes.Any())
            {
                columnName = ((System.Data.Linq.Mapping.ColumnAttribute)attributes.First()).Name;
            } else {
                columnName = ((System.ComponentModel.DataAnnotations.Schema.ColumnAttribute)attributes.First()).Name;
            }

            var expected = columnName.ToUpper();
            var propertyMap = new ColumnPropertyMap(_property);
            var actual = propertyMap.ColumnName;
            Assert.AreEqual(expected, actual);
        }
 public void ColumnPropertyMapSetMethodTest()
 {
     var propertyMap = new ColumnPropertyMap(_property);
     var actual = propertyMap.SetMethod;
     Assert.IsNotNull(actual);
 }
 public void ColumnPropertyMapConstructorTest()
 {
     var propertyMap = new ColumnPropertyMap(_property);
     // Make sure the object is not null
     Assert.IsNotNull(propertyMap);
 }
        public void ColumnPropertyMapSetMethodTest2()
        {
            var expected = new Random().Next(1000000);
            var testObject = new TestObject();
            var propertyMap = new ColumnPropertyMap(_property);
            var setMethod = propertyMap.SetMethod;
            setMethod.Invoke(testObject, expected);

            var actual = testObject.Id;

            Assert.AreEqual(expected, actual);
        }