Пример #1
0
        public void Gemma_LoadAndParse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_Gemma s = new TestTaxonomy_Gemma();

            int errors = 0;

            DateTime start = DateTime.Now;

            if (s.Load(GEMMA_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);

            // 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);
            }

            // duplicate elements
            Assert.AreEqual(0, errors, "parse failed due to bad reference loader errors");

            DateTime end = DateTime.Now;

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

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

            PresentationLink pl = s.presentationInfo["http://www.xbrl.org/2003/role/link"] as PresentationLink;

            Assert.IsNotNull(pl, "can't get http://www.xbrl.org/role/link");

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

            Assert.AreEqual(1, parentNode.Children.Count, "wrong number of children");
        }
Пример #2
0
        public void Gemma_LoadAndParse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_Gemma s = new TestTaxonomy_Gemma();

            int errors = 0;

            DateTime start = DateTime.Now;
            if ( s.Load( GEMMA_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 );

            // 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 );
            }

            // duplicate elements
            Assert.AreEqual( 0, errors, "parse failed due to bad reference loader errors" );

            DateTime end = DateTime.Now;
            Console.WriteLine( "Parse Time: {0}", end-start );
            TimeSpan level = new TimeSpan( 0, 0, 0, 5, 0 );	// 5 seconds to parse
            Assert.IsTrue( level > (end-start), "Parse takes too long" );

            PresentationLink pl = s.presentationInfo[ "http://www.xbrl.org/2003/role/link" ] as PresentationLink;
            Assert.IsNotNull( pl, "can't get http://www.xbrl.org/role/link" );

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