Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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"));
 }