public void DotNetField_Assembly_GetType()
        {
            //arrange
            Type       type       = typeof(A);
            DotNetType dotNetType = DotNetType.FromVisualStudioXml(XElement.Parse("<member name='T:A'></member>", LoadOptions.PreserveWhitespace));

            dotNetType.AddMember(DotNetField.FromVisualStudioXml(XElement.Parse("<member name='F:A.IntField'></member>", LoadOptions.PreserveWhitespace)));
            //act
            dotNetType.AddAssemblyInfo(type, dotNetType.Name);
            //assert
            Assert.IsNotNull(dotNetType.Fields[0].TypeName);
            Assert.AreEqual("System.Int32", dotNetType.Fields[0].TypeName.FullName);
        }
        public void DotNetField_Assembly_ArrayTypeField()
        {
            //arrange
            Type       type       = typeof(C);
            DotNetType dotNetType = DotNetType.FromVisualStudioXml(XElement.Parse("<member name='T:DataFilesTest.DotNetFieldTests.C'></member>", LoadOptions.PreserveWhitespace));

            dotNetType.AddMember(DotNetField.FromVisualStudioXml(XElement.Parse("<member name='F:DataFilesTest.DotNetFieldTests.C.FieldArray'></member>", LoadOptions.PreserveWhitespace)));
            //act
            dotNetType.AddAssemblyInfo(type, dotNetType.Name);
            //assert
            Assert.IsNotNull(dotNetType.Fields[0].TypeName);
            Assert.AreEqual("DataFilesTest.DotNetFieldTests.A[]", dotNetType.Fields[0].TypeName.FullName);
        }
Esempio n. 3
0
        public void DotNetReferenceClassGeneric_FromAssembly_Field()
        {
            //arrange
            Type       type       = typeof(ClassGeneric <>);
            DotNetType dotNetType = DotNetType.FromVisualStudioXml(XElement.Parse("<member name='T:DataFilesTest.DotNetReferenceClassGenericTests.ClassGeneric`1'></member>", LoadOptions.PreserveWhitespace));

            dotNetType.AddMember(DotNetField.FromVisualStudioXml(XElement.Parse("<member name='F:DataFilesTest.DotNetReferenceClassGenericTests.ClassGeneric`1.FieldA'></member>", LoadOptions.PreserveWhitespace)));
            //act
            dotNetType.AddAssemblyInfo(type, dotNetType.Name);
            //assert
            Assert.IsNotNull(dotNetType.Fields[0].TypeName);
            Assert.AreEqual("Apple", dotNetType.Fields[0].TypeName.FullName);
        }