Beispiel #1
0
        public void CheckPropertyIsRequired_ShouldReturnTrue_WhenGettingDefaultValue()
        {
            PropertyInfo[] propertyWithAttribute = typeof(SimpleClassWithAttribute).GetProperties();

            bool result = MatchingDatabaseFieldHelper.GetMatchingDatabaseFieldIsRequired(propertyWithAttribute[0]);

            Assert.IsTrue(result);
        }
Beispiel #2
0
        public void CheckPropertyIsRequired_ShouldReturnFalse_WhenSetToFalse()
        {
            PropertyInfo[] propertyWithAttribute = typeof(SimpleClassWithOptionalAttribute).GetProperties();

            bool result = MatchingDatabaseFieldHelper.GetMatchingDatabaseFieldIsRequired(propertyWithAttribute[0]);

            Assert.IsFalse(result);
        }
Beispiel #3
0
        public void GetColumnNamesFromProperty_ShouldReturnList_WhenGivenPropertyWithAttribute()
        {
            PropertyInfo[] propertyWithAttribute = (typeof(SimpleClassWithAttribute)).GetProperties();

            List <string> result = MatchingDatabaseFieldHelper.GetMatchingDatabaseFieldColumnNames(propertyWithAttribute[0]);

            Assert.IsTrue(result.Count != 0);
        }