Ejemplo n.º 1
0
        public void GAAP_LoadImportsAndBind()
        {
            TestTaxonomy_2005_02_28 s = new TestTaxonomy_2005_02_28();
            int errors = 0;

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

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

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

            Assert.AreEqual(0, errors, "wrong number of load import errors");

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

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

            Assert.AreEqual(0, errors, "wrong number of load presentation errors");

            errors = 0;
            s.LoadElements(out errors);
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
            }

            //Assert.AreEqual( 5, errors, "wrong number of load element errors" ); //no duplicate elements defined in the latest taxonomy
            Assert.AreEqual(0, errors, "wrong number of load element errors");
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
            }

            errors = 0;
            s.BindPresentationCalculationElements(true, out errors);

            Assert.AreEqual(0, errors, "wrong number of bind errors");
            Assert.AreEqual(0, s.numWarnings, "wrong number of warnings");

            // accounting policies is defined in the usfr-pt schema
            Assert.IsTrue(s.allElements.ContainsKey("usfr-pte_AccountingPolicies"), "usfr-pte_AccountingPolicies not found");
        }
Ejemplo n.º 2
0
        public void GAAP_ReadElements()
        {
            TestTaxonomy_2005_02_28 s = new TestTaxonomy_2005_02_28();
            int errors = 0;

            s.Load(US_GAAP_FILE);

            int numElements = s.LoadElements(out errors);

            Assert.AreEqual(0, errors);
            Assert.AreEqual(0, s.allElements.Count);
        }
Ejemplo n.º 3
0
        public void GAAP_TestDependantPresentations()
        {
            TestTaxonomy_2005_02_28 s = new TestTaxonomy_2005_02_28();
            int errors = 0;

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

            s.LoadImports( out errors );
            if ( errors > 0 )
            {
                SendErrorsToConsole( s.errorList );
            }

            s.LoadPresentation( out errors );

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

            if ( s.numWarnings > 0 )
            {
                SendWarningsToConsole( s.errorList );
                SendInfoToConsole( s.errorList );
            }

            errorList.Clear();
            errors = s.numWarnings = 0;
            s.LoadElements( out errors );

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

            if ( s.numWarnings > 0 )
            {
                SendWarningsToConsole( s.errorList );
                SendInfoToConsole( s.errorList );
            }

            // and now bind elements to presentation
            errorList.Clear();
            errors = s.numWarnings = 0;
            s.BindPresentationCalculationElements( true, out errors );

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

            if ( s.numWarnings > 0 )
            {
                SendWarningsToConsole( s.errorList );
                SendInfoToConsole( s.errorList );
            }

            // ok, now do some testing
            PresentationLink pl = s.presentationInfo["http://www.xbrl.org/us/fr/lr/role/StatementFinancialPosition"] as PresentationLink;

            Assert.IsNotNull( pl, "Presentation link is null" );

            PresentationLocator presLocator = null;
            pl.TryGetLocator( "usfr-pte_CommonStockShareSubscriptions", out presLocator );

            Assert.IsNotNull( presLocator, "presentation Locator not found" );
        }
Ejemplo n.º 4
0
        public void GAAP_ReadElements()
        {
            TestTaxonomy_2005_02_28 s = new TestTaxonomy_2005_02_28();
            int errors = 0;

            s.Load( US_GAAP_FILE );

            int numElements = s.LoadElements( out errors );
            Assert.AreEqual( 0, errors );
            Assert.AreEqual( 0, s.allElements.Count );
        }
Ejemplo n.º 5
0
        public void GAAP_LoadImportsAndBind()
        {
            TestTaxonomy_2005_02_28 s = new TestTaxonomy_2005_02_28();
            int errors = 0;

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

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

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

            Assert.AreEqual( 0, errors, "wrong number of load import errors" );

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

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

            Assert.AreEqual( 0, errors, "wrong number of load presentation errors" );

            errors = 0;
            s.LoadElements( out errors );
            if ( errors > 0 )
            {
                SendErrorsToConsole( s.errorList );
            }

            //Assert.AreEqual( 5, errors, "wrong number of load element errors" ); //no duplicate elements defined in the latest taxonomy
            Assert.AreEqual( 0, errors, "wrong number of load element errors" );
            if ( errors > 0 )
            {
                SendErrorsToConsole( s.errorList );
            }

            errors = 0;
            s.BindPresentationCalculationElements( true, out errors );

            Assert.AreEqual( 0, errors, "wrong number of bind errors" );
            Assert.AreEqual( 0, s.numWarnings, "wrong number of warnings" );

            // accounting policies is defined in the usfr-pt schema
            Assert.IsTrue( s.allElements.ContainsKey( "usfr-pte_AccountingPolicies" ), "usfr-pte_AccountingPolicies not found" );
        }
Ejemplo n.º 6
0
        public void GAAP_TestDependantPresentations()
        {
            TestTaxonomy_2005_02_28 s = new TestTaxonomy_2005_02_28();
            int errors = 0;

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

            s.LoadImports(out errors);
            if (errors > 0)
            {
                SendErrorsToConsole(s.errorList);
            }

            s.LoadPresentation(out errors);

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

            if (s.numWarnings > 0)
            {
                SendWarningsToConsole(s.errorList);
                SendInfoToConsole(s.errorList);
            }

            errorList.Clear();
            errors = s.numWarnings = 0;
            s.LoadElements(out errors);

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

            if (s.numWarnings > 0)
            {
                SendWarningsToConsole(s.errorList);
                SendInfoToConsole(s.errorList);
            }

            // and now bind elements to presentation
            errorList.Clear();
            errors = s.numWarnings = 0;
            s.BindPresentationCalculationElements(true, out errors);

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

            if (s.numWarnings > 0)
            {
                SendWarningsToConsole(s.errorList);
                SendInfoToConsole(s.errorList);
            }

            // ok, now do some testing
            PresentationLink pl = s.presentationInfo["http://www.xbrl.org/us/fr/lr/role/StatementFinancialPosition"] as PresentationLink;

            Assert.IsNotNull(pl, "Presentation link is null");

            PresentationLocator presLocator = null;

            pl.TryGetLocator("usfr-pte_CommonStockShareSubscriptions", out presLocator);

            Assert.IsNotNull(presLocator, "presentation Locator not found");
        }