Esempio n. 1
0
        public void TestCleanFieldNameReturnsPropertyNameForBackingField()
        {
            var fieldNames = typeof(Derived).GetAllFields().Select(f => ReflectionUtils.CleanFieldName(f.Name)).ToArray();

            CollectionAssert.Contains(fieldNames, nameof(Base.BaseProp));
            CollectionAssert.Contains(fieldNames, nameof(BaseTwo.BaseTwoProp));
            CollectionAssert.Contains(fieldNames, nameof(Derived.DerivedProp));
        }
Esempio n. 2
0
 public void TestCleanFieldName(string name, string expected)
 {
     Assert.AreEqual(expected, ReflectionUtils.CleanFieldName(name));
 }