Exemplo n.º 1
0
        public void TestGermanCI_Presentation()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );
            string fileName = TestCommon.FolderRoot + @"GermanCI_GCD" + System.IO.Path.DirectorySeparatorChar + "de-gaap-ci-2006-12-01.xsd";

            TestTaxonomy_MSFT_FIN s = new TestTaxonomy_MSFT_FIN();

            int errors = 0;

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

            s.Parse(out errors);

            Assert.AreEqual(0, errors, "should not have any errors");



            Assert.AreEqual(2677, s.allElements.Count, "wrong number of elements returned");

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

            ArrayList nodes = s.GetNodesByPresentation();

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

            Assert.AreEqual(11, nodes.Count, "wrong number of top level presentation nodes");
            Assert.AreEqual(2677, s.allElements.Count, "wrong number of elements returned");

            // loads the presentation linkbase for this taxonomy and merges the dependant taxonomy presentation linkbases
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
                SendWarningsToConsole(s.errorList);
                SendInfoToConsole(s.ErrorList);
            }

            // 37 advanced tuples
            Assert.AreEqual(0, errors, "parse failed");

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


            Element tupleChild = s.AllElements["de-gaap-ci_kke.limitedPartners.sumEquityAccounts.kinds.name.kkth.FK"] as Element;

            Assert.IsTrue(tupleChild.TupleParentList[0].Id == "de-gaap-ci_kke.limitedPartners.sumEquityAccounts.kinds.name", "Parent Id not set");


            Element tupleParent = s.AllElements["de-gaap-ci_kke.limitedPartners.sumEquityAccounts.kinds.name"] as Element;

            Assert.IsTrue(tupleParent.IsTuple, "Should be a tuple");
            Assert.IsTrue(tupleParent.HasChildren, "Should have child elements");

            Assert.AreEqual(14, tupleParent.TupleChildren.Count, "should have fourteen children elements");
        }
Exemplo n.º 2
0
        public void TestEtrade_Presentation()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );
            string fileName = TestCommon.FolderRoot + @"ETRADE-20060930" + System.IO.Path.DirectorySeparatorChar + "etfc-20060930.xsd";

            TestTaxonomy_MSFT_FIN s = new TestTaxonomy_MSFT_FIN();

            int errors = 0;

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

            errors = 0;

            s.LoadImports(out errors);
            s.LoadPresentation(out errors);
            s.LoadElements(out errors);
            s.BindPresentationCalculationElements(true, out errors);

            // loads the elements for this taxonomy and merges the dependant taxonomy elements
            errors = 0;
            //s.Parse( out errors );

            Assert.AreEqual(2525, s.allElements.Count, "wrong number of elements returned");

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

            ArrayList nodes = s.GetNodesByPresentation();

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

            Assert.AreEqual(7, nodes.Count, "wrong number of top level presentation nodes");
            Assert.AreEqual(2525, s.allElements.Count, "wrong number of elements returned");

            // loads the presentation linkbase for this taxonomy and merges the dependant taxonomy presentation linkbases
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
                SendWarningsToConsole(s.errorList);
                SendInfoToConsole(s.ErrorList);
            }

            // 37 advanced tuples
            Assert.AreEqual(0, errors, "parse failed");

            s.CurrentLabelRole = "preferredLabel";
            s.CurrentLanguage  = "en";
        }
Exemplo n.º 3
0
        public void MSFT_FIN_LoadAndParse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_MSFT_FIN s = new TestTaxonomy_MSFT_FIN();

            int errors = 0;

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

            errors = 0;

            s.LoadImports(out errors);
            s.LoadPresentation(out errors);
            s.LoadElements(out errors);
            s.BindPresentationCalculationElements(true, out errors);

            // loads the elements for this taxonomy and merges the dependant taxonomy elements
            errors = 0;
            //s.Parse( out errors );

            Assert.AreEqual(1837, s.allElements.Count, "wrong number of elements returned");

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

            ArrayList nodes = s.GetNodesByPresentation();

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

            Assert.AreEqual(1837, s.allElements.Count, "wrong number of elements returned");

            // loads the presentation linkbase for this taxonomy and merges the dependant taxonomy presentation linkbases
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
                SendWarningsToConsole(s.errorList);
                SendInfoToConsole(s.ErrorList);
            }

            // 37 advanced tuples
            Assert.AreEqual(0, errors, "parse failed");

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

            //ArrayList nodes = s.GetNodesByPresentation();
        }
Exemplo n.º 4
0
        public void MSFT_FIN_LoadAndParse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_MSFT_FIN s = new TestTaxonomy_MSFT_FIN();

            int errors = 0;

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

            errors = 0;

            s.LoadImports( out errors );
            s.LoadPresentation( out errors );
            s.LoadElements( out errors );
            s.BindPresentationCalculationElements( true, out errors );

            // loads the elements for this taxonomy and merges the dependant taxonomy elements
            errors = 0;
            //s.Parse( out errors );

            Assert.AreEqual( 1837, s.allElements.Count, "wrong number of elements returned" );

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

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

            Assert.AreEqual( 1837, s.allElements.Count, "wrong number of elements returned" );

            // loads the presentation linkbase for this taxonomy and merges the dependant taxonomy presentation linkbases
            if ( errors > 0 )
            {
                SendErrorsToConsole( s.errorList );
                SendWarningsToConsole( s.errorList );
                SendInfoToConsole( s.ErrorList );
            }

            // 37 advanced tuples
            Assert.AreEqual( 0, errors, "parse failed" );

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

            //ArrayList nodes = s.GetNodesByPresentation();
        }
Exemplo n.º 5
0
        public void TestEtrade_Calculation()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );
            string fileName = TestCommon.FolderRoot + @"ETRADE-20060930" + System.IO.Path.DirectorySeparatorChar + "etfc-20060930.xsd";

            TestTaxonomy_MSFT_FIN s = new TestTaxonomy_MSFT_FIN();

            int errors = 0;

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

            errors = 0;
            s.Parse(out errors);

            s.currentLabelRole = @"preferredLabel";
            s.currentLanguage  = @"en";

            ArrayList nodes = s.GetNodesByCalculation();

            Assert.AreEqual(5, nodes.Count, "wrong number of top level presentation nodes");
        }
Exemplo n.º 6
0
        public void TestGermanCI_Presentation()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );
            string fileName = TestCommon.FolderRoot + @"GermanCI_GCD" + System.IO.Path.DirectorySeparatorChar + "de-gaap-ci-2006-12-01.xsd";

            TestTaxonomy_MSFT_FIN s = new TestTaxonomy_MSFT_FIN();

            int errors = 0;

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

            s.Parse(out errors);

            Assert.AreEqual(0, errors, "should not have any errors");

            Assert.AreEqual(2677, s.allElements.Count, "wrong number of elements returned");

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

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

            Assert.AreEqual(11, nodes.Count, "wrong number of top level presentation nodes");
            Assert.AreEqual(2677, s.allElements.Count, "wrong number of elements returned");

            // loads the presentation linkbase for this taxonomy and merges the dependant taxonomy presentation linkbases
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
                SendWarningsToConsole(s.errorList);
                SendInfoToConsole(s.ErrorList);
            }

            // 37 advanced tuples
            Assert.AreEqual(0, errors, "parse failed");

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

            Element tupleChild = s.AllElements["de-gaap-ci_kke.limitedPartners.sumEquityAccounts.kinds.name.kkth.FK"] as Element;

            Assert.IsTrue(tupleChild.TupleParentList[0].Id == "de-gaap-ci_kke.limitedPartners.sumEquityAccounts.kinds.name", "Parent Id not set");

            Element tupleParent = s.AllElements["de-gaap-ci_kke.limitedPartners.sumEquityAccounts.kinds.name"] as Element;

            Assert.IsTrue(tupleParent.IsTuple, "Should be a tuple");
            Assert.IsTrue(tupleParent.HasChildren , "Should have child elements");

            Assert.AreEqual(14, tupleParent.TupleChildren.Count, "should have fourteen children elements");
        }
Exemplo n.º 7
0
        public void TestEtrade_Presentation()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );
            string fileName = TestCommon.FolderRoot + @"ETRADE-20060930" + System.IO.Path.DirectorySeparatorChar + "etfc-20060930.xsd";

            TestTaxonomy_MSFT_FIN s = new TestTaxonomy_MSFT_FIN();

            int errors = 0;

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

            errors = 0;

            s.LoadImports(out errors);
            s.LoadPresentation(out errors);
            s.LoadElements(out errors);
            s.BindPresentationCalculationElements(true, out errors);

            // loads the elements for this taxonomy and merges the dependant taxonomy elements
            errors = 0;
            //s.Parse( out errors );

            Assert.AreEqual(2525, s.allElements.Count, "wrong number of elements returned");

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

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

            Assert.AreEqual(7, nodes.Count, "wrong number of top level presentation nodes");
            Assert.AreEqual(2525, s.allElements.Count, "wrong number of elements returned");

            // loads the presentation linkbase for this taxonomy and merges the dependant taxonomy presentation linkbases
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
                SendWarningsToConsole(s.errorList);
                SendInfoToConsole(s.ErrorList);
            }

            // 37 advanced tuples
            Assert.AreEqual(0, errors, "parse failed");

            s.CurrentLabelRole = "preferredLabel";
            s.CurrentLanguage = "en";
        }
Exemplo n.º 8
0
        public void TestEtrade_Calculation()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );
            string fileName = TestCommon.FolderRoot + @"ETRADE-20060930" + System.IO.Path.DirectorySeparatorChar + "etfc-20060930.xsd";

            TestTaxonomy_MSFT_FIN s = new TestTaxonomy_MSFT_FIN();

            int errors = 0;

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

            errors = 0;
            s.Parse(out errors);

            s.currentLabelRole = @"preferredLabel";
            s.currentLanguage = @"en";

            ArrayList nodes = s.GetNodesByCalculation();
            Assert.AreEqual(5, nodes.Count, "wrong number of top level presentation nodes");
        }