コード例 #1
0
        public void MS_RoleTest()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_MS s = new TestTaxonomy_MS();

            int errors = 0;

            if (s.Load(MS_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.LoadImports(out errors);

            Assert.AreEqual(0, errors, "load imports failed");

            // loads the presentation linkbase for this taxonomy and merges the dependant taxonomy presentation linkbases
            errors = 0;
            s.LoadPresentation(out errors);

//			s.Parse( out errors );
//
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
                SendWarningsToConsole(s.errorList);
            }
            Assert.AreEqual(0, errors, "load presentation failed");

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

            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
                //				//SendWarningsToConsole( s.errorList );
            }

            Assert.AreEqual(0, errors, "load elements failed");

            s.BindPresentationCalculationElements(true, out errors);

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

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

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

            Assert.AreEqual(7, parentNode.Children.Count, "wrong number of children");
        }
コード例 #2
0
        public void MS_LoadAndParse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_MS s = new TestTaxonomy_MS();

            int errors = 0;

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

            Assert.AreEqual(0, errors, "parse failed");

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

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

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

            Assert.AreEqual(7, parentNode.Children.Count, "wrong number of children");

//			parentNode.Children.Sort();
//
//			Node earningsReleaseNode = parentNode.Children[13] as Node;
//
//			string text = null;
//			earningsReleaseNode.MyElement.TryGetLabel( "en", "label", out text );
//			Assert.AreEqual( "Earnings Release", text, "TryGetLabel wrong" );
//
//			Assert.AreEqual( "Earnings Release", earningsReleaseNode.Label, "label wrong" );
//
//			Node earningsReleaseText = earningsReleaseNode.Children[0] as Node;
//
//			earningsReleaseText.TryGetLabel( "en", "label", out text );
//			Assert.AreEqual( "Earnings Release Text", text, "Earnings Release Text label is wrong" );
        }
コード例 #3
0
        public void MS_LoadAndParse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_MS s = new TestTaxonomy_MS();

            int errors = 0;

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

            Assert.AreEqual( 0, errors, "parse failed" );

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

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

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

            Assert.AreEqual(7, parentNode.Children.Count, "wrong number of children" );

            //			parentNode.Children.Sort();
            //
            //			Node earningsReleaseNode = parentNode.Children[13] as Node;
            //
            //			string text = null;
            //			earningsReleaseNode.MyElement.TryGetLabel( "en", "label", out text );
            //			Assert.AreEqual( "Earnings Release", text, "TryGetLabel wrong" );
            //
            //			Assert.AreEqual( "Earnings Release", earningsReleaseNode.Label, "label wrong" );
            //
            //			Node earningsReleaseText = earningsReleaseNode.Children[0] as Node;
            //
            //			earningsReleaseText.TryGetLabel( "en", "label", out text );
            //			Assert.AreEqual( "Earnings Release Text", text, "Earnings Release Text label is wrong" );
        }
コード例 #4
0
        public void MS_RoleTest()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_MS s = new TestTaxonomy_MS();

            int errors = 0;

            if ( s.Load( MS_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.LoadImports( out errors );

            Assert.AreEqual( 0, errors, "load imports failed" );

            // loads the presentation linkbase for this taxonomy and merges the dependant taxonomy presentation linkbases
            errors = 0;
            s.LoadPresentation( out errors );

            //			s.Parse( out errors );
            //
            if ( errors > 0 )
            {
                SendErrorsToConsole( s.errorList );
                SendWarningsToConsole( s.errorList );
            }
            Assert.AreEqual( 0, errors, "load presentation failed" );

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

            if ( errors > 0 )
            {
                SendErrorsToConsole( s.errorList );
                //				//SendWarningsToConsole( s.errorList );
            }

            Assert.AreEqual( 0, errors, "load elements failed" );

            s.BindPresentationCalculationElements( true, out errors );

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

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

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

            Assert.AreEqual( 7, parentNode.Children.Count, "wrong number of children" );
        }