Пример #1
0
        public void GL_LoadAndParsePresentation()
        {
            TestTaxonomy_GE s = new TestTaxonomy_GE();
            int errors = 0;

            DateTime start = DateTime.Now;
            if (s.Load(GE_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
            // parse presentation first
            s.Parse(out errors);

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

            //make sure that role= http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsIndirect
            //has only one child. NetCashFlowsProvidedUsedOperatingActivitiesIndirectAbstract
            int found = 0;
            foreach (Node n in temp)
            {
                if (n.MyPresentationLink.Role == "http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsIndirect")
                {
                    found++;
                    Assert.AreEqual(1, n.Children.Count, "Should have only one child");
                    Assert.AreEqual("usfr-pte_NetCashFlowsProvidedUsedOperatingActivitiesIndirectAbstract", ((Node)(n.Children[0])).Id,
                        "Node id is not  correct");
                }
                else if (n.MyPresentationLink.Role == "http://www.xbrl.org/us/fr/lr/role/StatementCashFlows")
                {
                    found++;

                    Node StatementOfCashFlow = n.Children[1] as Node;

                    foreach( Node child in StatementOfCashFlow.Children )
                    {
                        if( child.Id == "usfr-pte_NetCashFlowsProvidedUsedInvestingActivitiesAbstract" )
                        {
                            found++;

                        }
                    }

                }
            }
            Assert.AreEqual(3, found, "Failed to find the link http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsIndirect");
        }
Пример #2
0
        public void GL_LoadAndParsePresentation()
        {
            TestTaxonomy_GE s      = new TestTaxonomy_GE();
            int             errors = 0;

            DateTime start = DateTime.Now;

            if (s.Load(GE_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
            // parse presentation first
            s.Parse(out errors);

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

            //make sure that role= http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsIndirect
            //has only one child. NetCashFlowsProvidedUsedOperatingActivitiesIndirectAbstract
            int found = 0;

            foreach (Node n in temp)
            {
                if (n.MyPresentationLink.Role == "http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsIndirect")
                {
                    found++;
                    Assert.AreEqual(1, n.Children.Count, "Should have only one child");
                    Assert.AreEqual("usfr-pte_NetCashFlowsProvidedUsedOperatingActivitiesIndirectAbstract", ((Node)(n.Children[0])).Id,
                                    "Node id is not  correct");
                }
                else if (n.MyPresentationLink.Role == "http://www.xbrl.org/us/fr/lr/role/StatementCashFlows")
                {
                    found++;

                    Node StatementOfCashFlow = n.Children[1] as Node;

                    foreach (Node child in StatementOfCashFlow.Children)
                    {
                        if (child.Id == "usfr-pte_NetCashFlowsProvidedUsedInvestingActivitiesAbstract")
                        {
                            found++;
                        }
                    }
                }
            }
            Assert.AreEqual(3, found, "Failed to find the link http://www.xbrl.org/us/fr/lr/role/CashFlowOperationsIndirect");
        }