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