private void PopulateControlFromEntity(IGenericCatWebControl correspondingControl, PropertyInfo entityProperty)
        {
            correspondingControl.SetDataSource(entityProperty.GetCustomAttributes(typeof(ReferenceMappingAttribute), false));

            object value = entityProperty.GetValue(_Entity, null);

            //If the catalogue is in add mode, the value is numeric and null, do not populate the catalogue. In all other situations.
            //populate the control with the corresponding value
            if (!(!_EditMode && ApplicationUtils.AssertValueIsNumeric(value) && ApplicationUtils.AssertValueIsNull(value)))
            {
                if (!(correspondingControl is IndCatTextBox && entityProperty.Name == "Rank" && !_EditMode))
                {
                    correspondingControl.SetValue(value);
                }
            }
        }
        public void AssertValueIsNullTest()
        {
            bool result;
            int  intTestValue = ApplicationConstants.INT_NULL_VALUE;

            result = ApplicationUtils.AssertValueIsNull(intTestValue);
            Assert.AreEqual(true, result);

            short shortTestValue = ApplicationConstants.SHORT_NULL_VALUE;

            result = ApplicationUtils.AssertValueIsNull(shortTestValue);
            Assert.AreEqual(true, result);

            decimal decimalTestValue = ApplicationConstants.DECIMAL_NULL_VALUE;

            result = ApplicationUtils.AssertValueIsNull(decimalTestValue);
            Assert.AreEqual(true, result);

            string stringTestValue = String.Empty;

            result = ApplicationUtils.AssertValueIsNull(stringTestValue);
            Assert.AreEqual(true, result);
        }