Ejemplo n.º 1
0
        public void Test_LoadAndParsePresentation_GCDA_Growth_Fund()
        {
            TestTaxonomy_EDGAROnline s = new TestTaxonomy_EDGAROnline();
            int    errors   = 0;
            string fileName = TestCommon.FolderRoot + @"GCDA_Growth_Fund" + System.IO.Path.DirectorySeparatorChar + "GComFunds.xsd";

            DateTime start = DateTime.Now;

            if (s.Load(fileName, out errors) != true)
            {
                Assert.Fail((string)s.ErrorList[0]);
            }

            errors = 0;

            // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases
            // parse presentation first

            s.CurrentLabelRole = "preferredLabel";
            s.CurrentLanguage  = "en";

            s.Parse(out errors);

            ArrayList nodes = s.GetNodesByPresentation();

            foreach (Node n in nodes)
            {
                StringBuilder sb = DisplayNode(n, 0);
                Console.WriteLine(sb.ToString());
            }
        }
Ejemplo n.º 2
0
        public void EDGAROnline_LoadAndParsePresentation()
        {
            TestTaxonomy_EDGAROnline s = new TestTaxonomy_EDGAROnline();
            int errors = 0;

            DateTime start = DateTime.Now;

            errors = s.Load(EDGARONLINE_FILE, false);
            if (errors != 0)
            {
                Assert.Fail((string)s.ErrorList[0]);
            }

            errors = 0;

            // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases
            // parse presentation first
            s.Parse(out errors);

            // there should be 1 error because there's a presentation arc that would create an infinite recursion
            Assert.AreEqual(1, errors, "wrong number of errors in presentation");

            //s.ErrorList.Sort();

            Console.WriteLine(((ParserMessage)s.ErrorList[0]).Message);

            DateTime end = DateTime.Now;

            Console.WriteLine("Parse Time: {0}", end - start);
            TimeSpan level = new TimeSpan(0, 0, 0, 10, 0);                      // 10 seconds to parse

            Assert.AreEqual(9, s.presentationInfo.Count, "wrong number of presentation links");
            PresentationLink pl = s.presentationInfo["http://www.xbrl.org/us/fr/lr/role/IncomeStatement"] as PresentationLink;

            Assert.IsNotNull(pl, "can't get http://www.xbrl.org/us/fr/lr/role/IncomeStatement from presentation");

            Node parentNode = pl.CreateNode("en", "label");

            Assert.AreEqual(2, parentNode.Children.Count, "wrong number of children in presentation");
            Assert.IsTrue(level > (end - start), "Parse takes too long - " + (end - start) + " seconds");
        }
Ejemplo n.º 3
0
        public void EDGAROnline_LoadAndParseCalculation()
        {
            for (int i = 0; i < 10; i++)
            {
                TestTaxonomy_EDGAROnline s = new TestTaxonomy_EDGAROnline();
                int errors = 0;

                DateTime start = DateTime.Now;
                if (s.Load(EDGARONLINE_FILE, out errors) != true)
                {
                    Assert.Fail((string)s.ErrorList[0]);
                }

                errors = 0;

                // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases
                s.Parse(out errors);

                // there should be 2 error because there's a calculation arc that would create an infinite recursion
                Assert.AreEqual(1, errors, "wrong number of errors in calculation");

                DateTime end = DateTime.Now;
                Console.WriteLine("Parse Time: {0}", end - start);
                TimeSpan level = new TimeSpan(0, 0, 0, 10, 0);                          // 10 seconds to parse
                Assert.AreEqual(10, s.calculationInfo.Count, "wrong number of calculation links");
                PresentationLink cl = s.calculationInfo["http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsDirect"] as PresentationLink;
                Assert.IsNotNull(cl, "can't get http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsDirect from calculation");

                Node parentNode = cl.CreateNode("en", "label");
                Assert.AreEqual(1, parentNode.Children.Count, "wrong number of children in calculation");

                s.currentLabelRole = @"preferredLabel";
                s.currentLanguage  = @"en";
                ArrayList temp = s.GetNodesByCalculation();

                Assert.IsTrue(level > (end - start), "Parse takes too long - " + (end - start) + " seconds");
            }
        }
Ejemplo n.º 4
0
        public void EDGAROnline_LoadAndParseCalculation()
        {
            for ( int i = 0; i < 10; i++ )
            {
                TestTaxonomy_EDGAROnline s = new TestTaxonomy_EDGAROnline();
                int errors = 0;

                DateTime start = DateTime.Now;
                if ( s.Load( EDGARONLINE_FILE, out errors ) != true )
                {
                    Assert.Fail( (string)s.ErrorList[0]);
                }

                errors = 0;

                // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases
                s.Parse( out errors );

                // there should be 2 error because there's a calculation arc that would create an infinite recursion
                Assert.AreEqual( 1, errors, "wrong number of errors in calculation" );

                DateTime end = DateTime.Now;
                Console.WriteLine( "Parse Time: {0}", end-start );
                TimeSpan level = new TimeSpan( 0, 0, 0, 10, 0 );	// 10 seconds to parse
                Assert.AreEqual(10, s.calculationInfo.Count, "wrong number of calculation links" );
                PresentationLink cl = s.calculationInfo[ "http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsDirect" ] as PresentationLink;
                Assert.IsNotNull( cl, "can't get http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsDirect from calculation" );

                Node parentNode = cl.CreateNode( "en", "label" );
                Assert.AreEqual(1, parentNode.Children.Count, "wrong number of children in calculation" );

                s.currentLabelRole = @"preferredLabel";
                s.currentLanguage = @"en";
                ArrayList temp = s.GetNodesByCalculation();

                Assert.IsTrue( level > (end-start), "Parse takes too long - " + (end-start) + " seconds"  );

            }
        }
Ejemplo n.º 5
0
        public void Test_LoadAndParsePresentation_GCDA_Growth_Fund()
        {
            TestTaxonomy_EDGAROnline s = new TestTaxonomy_EDGAROnline();
            int errors = 0;
            string fileName = TestCommon.FolderRoot + @"GCDA_Growth_Fund" +System.IO.Path.DirectorySeparatorChar +"GComFunds.xsd";

            DateTime start = DateTime.Now;
            if ( s.Load( fileName, out errors ) != true )
            {
                Assert.Fail( (string)s.ErrorList[0]);
            }

            errors = 0;

            // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases
            // parse presentation first

            s.CurrentLabelRole ="preferredLabel";
            s.CurrentLanguage = "en";

            s.Parse( out errors );

            ArrayList nodes = s.GetNodesByPresentation();

            foreach ( Node n in nodes )
            {
                StringBuilder sb = DisplayNode( n, 0 );
                Console.WriteLine( sb.ToString() );
            }
        }
Ejemplo n.º 6
0
        public void EDGAROnline_LoadAndParsePresentation()
        {
            TestTaxonomy_EDGAROnline s = new TestTaxonomy_EDGAROnline();
            int errors = 0;

            DateTime start = DateTime.Now;
            errors = s.Load( EDGARONLINE_FILE, false );
            if (  errors != 0 )
            {
                Assert.Fail( (string)s.ErrorList[0]);
            }

            errors = 0;

            // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases
            // parse presentation first
            s.Parse( out errors );

            // there should be 1 error because there's a presentation arc that would create an infinite recursion
            Assert.AreEqual( 1, errors, "wrong number of errors in presentation" );

            //s.ErrorList.Sort();

            Console.WriteLine( ((ParserMessage)s.ErrorList[0]).Message );

            DateTime end = DateTime.Now;
            Console.WriteLine( "Parse Time: {0}", end-start );
            TimeSpan level = new TimeSpan( 0, 0, 0, 10, 0 );	// 10 seconds to parse

            Assert.AreEqual(9, s.presentationInfo.Count, "wrong number of presentation links" );
            PresentationLink pl = s.presentationInfo[ "http://www.xbrl.org/us/fr/lr/role/IncomeStatement" ] as PresentationLink;
            Assert.IsNotNull( pl, "can't get http://www.xbrl.org/us/fr/lr/role/IncomeStatement from presentation" );

            Node parentNode = pl.CreateNode( "en", "label" );
            Assert.AreEqual(2, parentNode.Children.Count, "wrong number of children in presentation" );
            Assert.IsTrue( level > (end-start), "Parse takes too long - " + (end-start) + " seconds"  );
        }