public void GAAP_Parse() { TestTaxonomy_2005_02_28 s = new TestTaxonomy_2005_02_28(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(US_GAAP_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; s.Parse(out errors); if (errors > 0) { SendErrorsToConsole(s.errorList); } DateTime end = DateTime.Now; Console.WriteLine("Parse Time: {0}", end - start); PresentationLink pl = s.presentationInfo["http://www.xbrl.org/us/fr/lr/role/StatementCashFlows"] as PresentationLink; Assert.IsNotNull(pl, "presentation link not found"); Assert.IsNotNull(pl.BaseSchema, "PresentationLink BaseSchema is null"); Assert.AreEqual("http://www.xbrl.org/us/fr/gaap/ci/2005-02-28/us-gaap-ci-2005-02-28.xsd", pl.BaseSchema, "BaseSchema wrong"); PresentationLocator ploc = null; Assert.IsTrue(pl.TryGetLocator("usfr-pte_NetIncreaseDecreaseCashCashEquivalents", out ploc)); Assert.AreEqual(0, errors, "parse failure"); if (s.numWarnings > 0) { Assert.AreEqual(s.numWarnings, SendWarningsToConsole(s.errorList), "numWarnings doesn't match warnings reported in the errorList"); } Assert.AreEqual(0, s.numWarnings, "wrong number of warnings "); // 57 = bind failures - elements w/o presentation //Trace.Listeners.Clear(); TimeSpan level = new TimeSpan(0, 0, 0, 5, 0); // 5 seconds to parse Assert.IsTrue(level > (end - start), "Parse takes too long - " + (end - start) + " seconds"); }
[Test] public void IFRS_Parse() { //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) ); TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(IFRS_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; s.Parse(out errors); if (errors > 0) { SendErrorsToConsole(s.errorList); //SendWarningsToConsole( s.errorList ); } DateTime end = DateTime.Now; Console.WriteLine("Parse Time: {0}", end - start); TimeSpan level = new TimeSpan(0, 0, 0, 4, 0); // 4 seconds to parse Assert.IsTrue(level > (end - start), "Parse takes too long"); PresentationLink pl = s.presentationInfo["http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetClassified"] as PresentationLink; Assert.IsNotNull(pl, "can't find Balance Sheet, Classified Format"); PresentationLocator ploc = null; Assert.IsTrue(pl.TryGetLocator("ifrs-gp_HedgingInstrumentsNonCurrentLiability", out ploc)); // problem with presentation linkbase - don't know the solution yet Assert.AreEqual(0, errors, "parse failure"); Assert.AreEqual(0, s.numWarnings, "wrong number of warnings "); // 1712 = calculation warnings //Trace.Listeners.Clear(); }
public void BASI_Parse() { TestTaxonomy_2004_08_15 s = new TestTaxonomy_2004_08_15(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(BASI_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; s.Parse(out errors); DateTime end = DateTime.Now; if (errors > 0) { SendErrorsToConsole(s.errorList); } Console.WriteLine("Parse Time: {0}", end - start); PresentationLink pl = s.presentationInfo["http://www.xbrl.org/us/fr/lr/role/StatementCashFlowsDirect"] as PresentationLink; Assert.IsNotNull(pl, "presentation link not found"); PresentationLocator ploc = null; Assert.IsTrue(pl.TryGetLocator("usfr-pt_NetIncreaseDecreaseCashCashEquivalents", out ploc)); Assert.AreEqual(0, errors, "parse failure"); // 1 - duplicate element if (s.numWarnings > 7) { Assert.AreEqual(s.numWarnings, SendWarningsToConsole(s.errorList), "numWarnings doesn't match warnings reported in the errorList"); } Assert.AreEqual(7, s.numWarnings, "wrong number of warnings "); TimeSpan level = new TimeSpan(0, 0, 0, 8, 0); // 8 seconds to parse TimeSpan timeTaken = end - start; Assert.IsTrue(level > timeTaken, "Parse takes too long - " + timeTaken.ToString() + " seconds"); }
[Test] public void GAAP_Parse() { //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) ); TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(US_GAAP_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; s.Parse(out errors); DateTime end = DateTime.Now; Console.WriteLine("Parse Time: {0}", end - start); TimeSpan level = new TimeSpan(0, 0, 0, 4, 0); // 4 seconds to parse Assert.IsTrue(level > (end - start), "Parse takes too long"); PresentationLink pl = s.presentationInfo["Statement of Cash Flows - Direct Method - CI"] as PresentationLink; Assert.IsNotNull(pl); PresentationLocator ploc = null; Assert.IsTrue(pl.TryGetLocator("usfr-pt_NetIncreaseDecreaseCashCashEquivalents", out ploc)); Assert.AreEqual(22 + 690 + 5 + 4 + 5 + 953 + 1474, errors, "parse failure"); // 22 = presentation load errors // 690 = bind failures - elements w/o presentation // 5 = imports - 5 duplicate elements // 4 = duplicate labels // 5 = elements without matching labels // 953 = elements without ref // 1474 = element without calc //Trace.Listeners.Clear(); }
[Test] public void GAAP_Parse() { //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) ); TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(US_GAAP_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; s.Parse(out errors); DateTime end = DateTime.Now; Console.WriteLine("Parse Time: {0}", end - start); PresentationLink pl = s.presentationInfo["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect"] as PresentationLink; Assert.IsNotNull(pl, "presentation link is null"); PresentationLocator ploc = null; Assert.IsTrue(pl.TryGetLocator("usfr-pt_NetIncreaseDecreaseCashCashEquivalents", out ploc)); // problem with presentation linkbase - don't know the solution yet Assert.AreEqual(5, errors, "parse failure"); Assert.AreEqual(2, s.numWarnings, "wrong number of warnings"); // 2 = duplicate labels //Trace.Listeners.Clear(); TimeSpan level = new TimeSpan(0, 0, 0, 4, 0); // 4 seconds to parse Assert.IsTrue(level > (end - start), "Parse takes too long"); }
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"); }