public void Constructor_Identifies_NestedPublicAccessCorrectly() { var internalStruct = new TypeWrapper(typeof(PublicStruct).Assembly.DefinedTypes.Single(x => x.Name == "NestedPublicStruct")); var SUT = new StructTypeData(internalStruct); Assert.That(SUT.AccessLevel == AccessLevelEnum.Public); Assert.That(SUT.Type == TypeEnum.Struct); }
public void Constructor_Parses_StructStringInput() { var testType = new StructTypeData(new TypeWrapper(typeof(PublicStructWithAttributes))); var testString = testType.ToString(); var SUT = new StructTypeData(testString); Assert.NotNull(SUT); Assert.That(SUT.AccessLevel == AccessLevelEnum.Public); Assert.That(SUT.AttributeData.Count == testType.AttributeData.Count); Assert.That(SUT.AttributeData.Any(x => x.Name == typeof(TestAttributeAttribute).FullName)); Assert.That(SUT.Type == testType.Type); }
public void Constructor_Throws_WhenPassedEnum() { var SUT = new StructTypeData(new TypeWrapper(typeof(PublicEnum))); }
public void Constructor_Identifies_PublicAccessCorrectly() { var SUT = new StructTypeData(new TypeWrapper(typeof(PublicStruct))); Assert.That(SUT.AccessLevel == AccessLevelEnum.Public); Assert.That(SUT.Type == TypeEnum.Struct); }
public void Constructor_IdentifiesClassTypesCorrectly() { var SUT = new StructTypeData(new TypeWrapper(typeof(PublicStruct))); Assert.That(SUT.Type == TypeEnum.Struct); }
public void ToString_BuildsCorrectString_ForPublicStruct() { var SUT = new StructTypeData(new TypeWrapper(typeof(PublicStruct))); var stringRepresentation = SUT.ToString(); Assert.That(stringRepresentation.StartsWith("\tpublic struct Ntegrity.TestTargetAssembly.PublicStruct")); }
public void Constructor_Throws_WhenPassedInterface() { var SUT = new StructTypeData(new TypeWrapper(typeof(IPublicInterface))); }