public void FieldWithAttributes_HasAttributes() { var field = new FieldInfoWrapper(typeof(ContainerClass).GetFields().Single(x => x.Name == "PublicFieldWithAttributes")); var SUT = new FieldData(field); Assert.That(SUT.AttributeData.Count > 0); Assert.That(SUT.AttributeData.Any(x => x.Name == typeof(TestAttributeAttribute).FullName)); }
public void PublicFieldDataFromString_IsPublic() { var testString = "\t\tpublic Void TestField"; var fieldData = new FieldData(testString); Assert.That(fieldData.AccessLevel == AccessLevelEnum.Public); }
public void PublicFieldAccessLevel_IsPublic() { var field = new FieldInfoWrapper(typeof(ContainerClass).GetFields().Single(x => x.Name == "PublicFieldWithAttributes")); var SUT = new FieldData(field); Assert.That(SUT.AccessLevel == AccessLevelEnum.Public); }
public void ProtectedFieldDataFromString_IsProtected() { var testString = "\t\tprotected Void TestField"; var fieldData = new FieldData(testString); Assert.That(fieldData.AccessLevel == AccessLevelEnum.Protected); }
public void PrivateFieldDataFromString_IsPrivate() { var testString = "\t\tprivate Void TestField"; var fieldData = new FieldData(testString); Assert.That(fieldData.AccessLevel == AccessLevelEnum.Private); }
public void InternalFieldDataFromString_IsInternal() { var testString = "\t\tinternal Void TestField"; var fieldData = new FieldData(testString); Assert.That(fieldData.AccessLevel == AccessLevelEnum.Internal); }