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

            TestTaxonomy_XINT s = new TestTaxonomy_XINT();

            int errors = 0;

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

            Assert.AreEqual(0, errors, "errors returned from parse");

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

            errors = 0;
            ArrayList nodes = s.GetNodes(PresentationStyle.Presentation, false, out errors);


            Assert.IsTrue(errors == 0, "errors returned from calculation");
        }
コード例 #2
0
        public void XINT_LoadAndParse_Calculation()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_XINT s = new TestTaxonomy_XINT();

            int errors = 0;

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

            Assert.AreEqual( 0, errors, "errors returned from parse" );

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

            errors = 0;
            ArrayList nodes = s.GetNodes(PresentationStyle.Presentation, false, out errors);

            Assert.IsTrue( errors == 0, "errors returned from calculation" );
        }
コード例 #3
0
        public void XINT_LoadAndParse()
        {
            TestTaxonomy_XINT s = new TestTaxonomy_XINT();

            int errors = 0;

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

            Assert.AreEqual(0, errors, "errors returned from parse");

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

            ArrayList nodes = s.GetNodesByPresentation();

            Node xbrlInt = nodes[7] as Node;

            Assert.IsNotNull(xbrlInt, "XBRL International is null");
            Assert.AreEqual(5, xbrlInt.Children.Count, "wrong number of children");

            Node statements = xbrlInt.Children[4] as Node;

            Assert.IsNotNull(statements, "statements is null");
            Assert.AreEqual(4, statements.Children.Count, "statements has wrong number of children");

            Node assets = statements.Children[0] as Node;

            Assert.IsNotNull(assets, "assets is null");
            Assert.AreEqual(7, assets.Children.Count, "assets has wrong number of children");

            Node cashcashequiv = assets.Children[0] as Node;

            Assert.IsNotNull(cashcashequiv, "cash cash eqivalents is null");

//	this may be correct - commented out until we figure out how things should work
//
//			string text = null;
//			cashcashequiv.TryGetLabel( "en", "preferredLabel", out text );
//			Assert.AreEqual( "Cash and Cash Equivalents", text, "cashcasheqiv label incorrect" );
//
//			Assert.AreEqual( "Cash and Cash Equivalents", cashcashequiv.Label, "cashcasheqiv label incorrect" );

//			Node acctReceiveNet = assets.Children[1] as Node;
//
//			acctReceiveNet.MyElement.PreferredLabel = null;
//			acctReceiveNet.SetLabel( "en", "preferredLabel" );
//			acctReceiveNet.TryGetLabel( "en", "preferredLabel", out text );
//			Assert.AreEqual( "Dues receivable, net of allowance of $12,445 and $2,500", text, "acctReceiveNet label incorrect" );
//
//			Assert.IsNotNull( acctReceiveNet, "acctReceiveNet is null" );
//			Assert.AreEqual( "Dues receivable, net of allowance of $12,445 and $2,500", acctReceiveNet.Label, "acctRecieveNet.Label is wrong" );
        }
コード例 #4
0
        public void XINT_LoadAndParse()
        {
            TestTaxonomy_XINT s = new TestTaxonomy_XINT();

            int errors = 0;

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

            Assert.AreEqual( 0, errors, "errors returned from parse" );

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

            ArrayList nodes = s.GetNodesByPresentation();

            Node xbrlInt = nodes[7] as Node;

            Assert.IsNotNull( xbrlInt, "XBRL International is null");
            Assert.AreEqual( 5, xbrlInt.Children.Count, "wrong number of children" );

            Node statements = xbrlInt.Children[4] as Node;
            Assert.IsNotNull( statements, "statements is null" );
            Assert.AreEqual( 4, statements.Children.Count, "statements has wrong number of children" );

            Node assets = statements.Children[0] as Node;
            Assert.IsNotNull( assets, "assets is null" );
            Assert.AreEqual( 7, assets.Children.Count, "assets has wrong number of children" );

            Node cashcashequiv = assets.Children[0] as Node;
            Assert.IsNotNull( cashcashequiv, "cash cash eqivalents is null" );

            //	this may be correct - commented out until we figure out how things should work
            //
            //			string text = null;
            //			cashcashequiv.TryGetLabel( "en", "preferredLabel", out text );
            //			Assert.AreEqual( "Cash and Cash Equivalents", text, "cashcasheqiv label incorrect" );
            //
            //			Assert.AreEqual( "Cash and Cash Equivalents", cashcashequiv.Label, "cashcasheqiv label incorrect" );

            //			Node acctReceiveNet = assets.Children[1] as Node;
            //
            //			acctReceiveNet.MyElement.PreferredLabel = null;
            //			acctReceiveNet.SetLabel( "en", "preferredLabel" );
            //			acctReceiveNet.TryGetLabel( "en", "preferredLabel", out text );
            //			Assert.AreEqual( "Dues receivable, net of allowance of $12,445 and $2,500", text, "acctReceiveNet label incorrect" );
            //
            //			Assert.IsNotNull( acctReceiveNet, "acctReceiveNet is null" );
            //			Assert.AreEqual( "Dues receivable, net of allowance of $12,445 and $2,500", acctReceiveNet.Label, "acctRecieveNet.Label is wrong" );
        }