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