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)); }
public void TestCleanFieldName(string name, string expected) { Assert.AreEqual(expected, ReflectionUtils.CleanFieldName(name)); }