[Test][Ignore("display only")] public void IFRS_Test_VerifyTuples() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.CurrentLabelRole = "label"; s.CurrentLanguage = "en"; s.Load(IFRS_FILE); int errors = 0; s.Parse(out errors); ArrayList nodeList = s.GetNodesByElement(); Assert.IsNotNull(nodeList); Assert.AreEqual(2586, nodeList.Count); Console.WriteLine("Found Tuple Nodes: "); foreach (Node n in nodeList) { RecurseVerifyTuples(n); } }
[Test] public void IFRS_ElementTaxonomyLinks() { //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) ); TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); int errors = 0; if (s.Load(IFRS_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; s.Parse(out errors); s.currentLanguage = "en"; s.currentLabelRole = "label"; ArrayList nodes = s.GetNodesByElement(); Assert.AreEqual(0, ((Node)nodes[0]).TaxonomyInfoId, "Taxonomy id not correct"); TaxonomyItem ti = s.GetTaxonomyInfo((Node)nodes[0]); Assert.AreEqual("http://xbrl.iasb.org/int/fr/ifrs/gp/2004-06-15", ti.WebLocation, "target namespace wrong"); Assert.AreEqual(IFRS_FILE, ti.Location, "targetLocation wrong"); }
[Test][Ignore("Display only")] public void IFRS_Test_GetNodesByElement() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.CurrentLabelRole = "label"; s.CurrentLanguage = "en"; s.Load(IFRS_FILE); int errors = 0; s.Parse(out errors); ArrayList nodeList = s.GetNodesByElement(); Assert.IsNotNull(nodeList); Assert.AreEqual(2591, nodeList.Count); Console.WriteLine("Nodes By Element: "); foreach (Node n in nodeList) { Console.WriteLine(TestNode.ToXml(0, n)); } }
[Test] public void IFRS_Parse_Label() { 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); DateTime end = DateTime.Now; Console.WriteLine("Parse Time: {0}", end - start); Element el = s.allElements["AmountDeferredExpenditureNonCurrent"] as Element; Assert.IsNotNull(el, "can't find AmountDeferredExpenditureNonCurrent"); string labelString = string.Empty; el.TryGetLabel("en", "label", out labelString); Assert.IsTrue(labelString != "", "lable info is not populated"); }
public void IFRS_BindCalculation() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); int errors = 0; if ( s.Load( IFRS_FILE, out errors ) != true ) { Assert.Fail( (string)s.ErrorList[0] ); } errors = 0; s.Parse( out errors ); // errors = 0; // s.LoadCalculation( out errors ); // Assert.AreEqual( 0, errors, "load calc failed" ); // s.numWarnings = errors = 0; //s.BindCalculation( out errors ); s.BindElements( new BindElementDelegate( s.BindElementToCalculationLocator ), out errors ); if ( errors != 0 ) { SendErrorsToConsole( s.errorList ); } // if ( s.numWarnings != 0 ) // { // SendWarningsToConsole( s.errorList, "Can't find presentation link for element" ); // } Assert.AreEqual( 0, errors, "Bind calc failed" ); Assert.AreEqual( 0, s.numWarnings, "num warnings wrong" ); }
[Test] public void IFRS_BindCalculation() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); int errors = 0; if (s.Load(IFRS_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; s.Parse(out errors); // errors = 0; // s.LoadCalculation( out errors ); // Assert.AreEqual( 0, errors, "load calc failed" ); // s.numWarnings = errors = 0; //s.BindCalculation( out errors ); s.BindElements(new BindElementDelegate(s.BindElementToCalculationLocator), out errors); if (errors != 0) { SendErrorsToConsole(s.errorList); } // if ( s.numWarnings != 0 ) // { // SendWarningsToConsole( s.errorList, "Can't find presentation link for element" ); // } Assert.AreEqual(0, errors, "Bind calc failed"); Assert.AreEqual(0, s.numWarnings, "num warnings wrong"); }
[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(); }
[Test][Ignore("Display only")] public void IFRS_OutputTaxonomy() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.Load(IFRS_FILE); int errors = 0; s.Parse(out errors); #if !AUTOMATED using (StreamWriter sw = new StreamWriter(IFRS_OUT_FILE)) { sw.Write(s.ToXmlString(false)); } #endif }
[Test][Ignore("Display only")] public void IFRS_VerifyPresentationCorrect() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.Load(IFRS_FILE); int errors = 0; s.Parse(out errors); string rawXml = s.ToXmlString(); s.currentLabelRole = "terseLabel"; s.CurrentLanguage = "en"; ArrayList nodes = s.GetNodesByPresentation(); }
[Test] public void IFRS_TestTuples() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); int errors = 0; s.Load(IFRS_FILE); s.Parse(out errors); IDictionaryEnumerator enumer = s.allElements.GetEnumerator(); Console.WriteLine("Found Tuple Elements: "); while (enumer.MoveNext()) { RecurseElementsForTuples(enumer.Value as Element); } }
[Test][Ignore("Display only")] public void IFRS_OutputTaxonomyByNodes() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.Load(IFRS_FILE); int errors = 0; s.Parse(out errors); #if !AUTOMATED using (StreamWriter sw = new StreamWriter(NODE_OUT_FILE)) { s.currentLanguage = "en"; s.currentLabelRole = "terseLabel"; sw.Write(s.ToXmlString(s.GetNodesByPresentation())); } #endif }
public void IFRS_TestTuples() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); int errors = 0; s.Load( IFRS_FILE ); s.Parse( out errors ); IDictionaryEnumerator enumer = s.allElements.GetEnumerator(); Console.WriteLine( "Found Tuple Elements: " ); while ( enumer.MoveNext() ) { RecurseElementsForTuples( enumer.Value as Element ); } }
public void IFRS_Parse_Label() { 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 ); DateTime end = DateTime.Now; Console.WriteLine( "Parse Time: {0}", end-start ); Element el = s.allElements["AmountDeferredExpenditureNonCurrent"] as Element; Assert.IsNotNull( el, "can't find AmountDeferredExpenditureNonCurrent" ); string labelString = string.Empty; el.TryGetLabel("en", "label", out labelString); Assert.IsTrue(labelString != "", "lable info is not populated"); }
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 IFRS_OutputTaxonomyByNodes() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.Load( IFRS_FILE); int errors = 0; s.Parse( out errors ); #if !AUTOMATED using ( StreamWriter sw = new StreamWriter( NODE_OUT_FILE ) ) { s.currentLanguage = "en"; s.currentLabelRole = "terseLabel"; sw.Write( s.ToXmlString( s.GetNodesByPresentation() ) ); } #endif }
public void IFRS_OutputTaxonomy() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.Load( IFRS_FILE); int errors = 0; s.Parse( out errors ); #if !AUTOMATED using ( StreamWriter sw = new StreamWriter( IFRS_OUT_FILE ) ) { sw.Write( s.ToXmlString( false ) ); } #endif }
public void IFRS_VerifyPresentationCorrect() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.Load( IFRS_FILE); int errors = 0; s.Parse( out errors ); string rawXml = s.ToXmlString(); s.currentLabelRole = "terseLabel"; s.CurrentLanguage = "en"; ArrayList nodes = s.GetNodesByPresentation(); }
public void IFRS_Test_GetNodesByPresentation() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.CurrentLabelRole = "label"; s.CurrentLanguage = "en"; s.Load( IFRS_FILE); int errors = 0; s.Parse( out errors ); ArrayList nodeList = s.GetNodesByPresentation(); Assert.IsNotNull( nodeList ); Assert.AreEqual( 24, nodeList.Count ); Console.WriteLine( "Nodes By Presentation: " ); foreach (Node n in nodeList ) { Console.WriteLine( TestNode.ToXml( 0, n ) ); } }
public void IFRS_Test_VerifyTuples() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.CurrentLabelRole = "label"; s.CurrentLanguage = "en"; s.Load( IFRS_FILE); int errors = 0; s.Parse( out errors ); ArrayList nodeList = s.GetNodesByElement(); Assert.IsNotNull( nodeList ); Assert.AreEqual( 2586, nodeList.Count ); Console.WriteLine( "Found Tuple Nodes: " ); foreach (Node n in nodeList ) { RecurseVerifyTuples( n ); } }
[Test] public void VerifyTupleOfTuples() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.CurrentLabelRole = "label"; s.CurrentLanguage = "en"; s.Load(IFRS_FILE); int errors = 0; s.Parse(out errors); // find EquityCompensationPlan - it's a tuple, and should have ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod as a child // (it's also a tuple) Element e = s.allElements["EquityCompensationPlan"] as Element; Assert.IsNotNull(e, "can't find EquityCompensationPlan"); bool found = false; foreach (Element ec in e.Children) { if (ec.Name == "ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod") { found = true; break; } } Assert.IsTrue(found, "could not find ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod"); Assert.IsFalse(s.boundElements.ContainsKey("ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod"), "ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod found in boundElements"); // find RelatedParty - it's a tuple, and should have TransactionRelatedParty as a child // (it's also a tuple) e = s.allElements["RelatedParty"] as Element; Assert.IsNotNull(e, "can't find RelatedParty"); found = false; foreach (Element ec in e.Children) { if (ec.Name == "TransactionRelatedParty") { found = true; break; } } Assert.IsTrue(found, "could not find TransactionRelatedParty"); Assert.IsFalse(s.boundElements.ContainsKey("TransactionRelatedParty"), "TransactionRelatedParty found in boundElements"); // find EquityCompensationPlan - it's a tuple, and should have EquityInstrumentIssuedEquityCompensationPlan as a child // (it's also a tuple) e = s.allElements["EquityCompensationPlan"] as Element; Assert.IsNotNull(e, "can't find EquityCompensationPlan"); found = false; foreach (Element ec in e.Children) { if (ec.Name == "EquityInstrumentIssuedEquityCompensationPlan") { found = true; break; } } Assert.IsTrue(found, "could not find EquityInstrumentIssuedEquityCompensationPlan "); Assert.IsFalse(s.boundElements.ContainsKey("EquityInstrumentIssuedEquityCompensationPlan"), "EquityInstrumentIssuedEquityCompensationPlan found in boundElements"); // find EquityCompensationPlan - it's a tuple, and should have MajorClassAssetLiabilityEntityAcquired as a child // (it's also a tuple) e = s.allElements["Acquisition"] as Element; Assert.IsNotNull(e, "can't find Acquisition"); found = false; foreach (Element ec in e.Children) { if (ec.Name == "MajorClassAssetLiabilityEntityAcquired") { found = true; break; } } Assert.IsTrue(found, "could not find MajorClassAssetLiabilityEntityAcquired "); Assert.IsFalse(s.boundElements.ContainsKey("MajorClassAssetLiabilityEntityAcquired"), "MajorClassAssetLiabilityEntityAcquired found in boundElements"); // find EquityCompensationPlan - it's a tuple, and should have OwnEquityInstrumentHeldEquityCompensationPlan as a child // (it's also a tuple) e = s.allElements["EquityCompensationPlan"] as Element; Assert.IsNotNull(e, "can't find EquityCompensationPlan"); found = false; foreach (Element ec in e.Children) { if (ec.Name == "OwnEquityInstrumentHeldEquityCompensationPlan") { found = true; break; } } Assert.IsTrue(found, "could not find OwnEquityInstrumentHeldEquityCompensationPlan "); Assert.IsFalse(s.boundElements.ContainsKey("OwnEquityInstrumentHeldEquityCompensationPlan"), "OwnEquityInstrumentHeldEquityCompensationPlan found in boundElements"); }
public void VerifyTupleOfTuples() { TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); s.CurrentLabelRole = "label"; s.CurrentLanguage = "en"; s.Load( IFRS_FILE); int errors = 0; s.Parse( out errors ); // find EquityCompensationPlan - it's a tuple, and should have ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod as a child // (it's also a tuple) Element e = s.allElements[ "EquityCompensationPlan" ] as Element; Assert.IsNotNull( e, "can't find EquityCompensationPlan" ); bool found = false; foreach ( Element ec in e.Children ) { if ( ec.Name == "ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod" ) { found = true; break; } } Assert.IsTrue( found, "could not find ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod" ); Assert.IsFalse( s.boundElements.ContainsKey("ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod"), "ShareOptionsExercisedUnderEquityCompensationPlansDuringPeriod found in boundElements" ); // find RelatedParty - it's a tuple, and should have TransactionRelatedParty as a child // (it's also a tuple) e = s.allElements[ "RelatedParty" ] as Element; Assert.IsNotNull( e, "can't find RelatedParty" ); found = false; foreach ( Element ec in e.Children ) { if ( ec.Name == "TransactionRelatedParty" ) { found = true; break; } } Assert.IsTrue( found, "could not find TransactionRelatedParty" ); Assert.IsFalse( s.boundElements.ContainsKey("TransactionRelatedParty"), "TransactionRelatedParty found in boundElements" ); // find EquityCompensationPlan - it's a tuple, and should have EquityInstrumentIssuedEquityCompensationPlan as a child // (it's also a tuple) e = s.allElements[ "EquityCompensationPlan" ] as Element; Assert.IsNotNull( e, "can't find EquityCompensationPlan" ); found = false; foreach ( Element ec in e.Children ) { if ( ec.Name == "EquityInstrumentIssuedEquityCompensationPlan" ) { found = true; break; } } Assert.IsTrue( found, "could not find EquityInstrumentIssuedEquityCompensationPlan " ); Assert.IsFalse( s.boundElements.ContainsKey("EquityInstrumentIssuedEquityCompensationPlan"), "EquityInstrumentIssuedEquityCompensationPlan found in boundElements" ); // find EquityCompensationPlan - it's a tuple, and should have MajorClassAssetLiabilityEntityAcquired as a child // (it's also a tuple) e = s.allElements[ "Acquisition" ] as Element; Assert.IsNotNull( e, "can't find Acquisition" ); found = false; foreach ( Element ec in e.Children ) { if ( ec.Name == "MajorClassAssetLiabilityEntityAcquired" ) { found = true; break; } } Assert.IsTrue( found, "could not find MajorClassAssetLiabilityEntityAcquired " ); Assert.IsFalse( s.boundElements.ContainsKey("MajorClassAssetLiabilityEntityAcquired"), "MajorClassAssetLiabilityEntityAcquired found in boundElements" ); // find EquityCompensationPlan - it's a tuple, and should have OwnEquityInstrumentHeldEquityCompensationPlan as a child // (it's also a tuple) e = s.allElements[ "EquityCompensationPlan" ] as Element; Assert.IsNotNull( e, "can't find EquityCompensationPlan" ); found = false; foreach ( Element ec in e.Children ) { if ( ec.Name == "OwnEquityInstrumentHeldEquityCompensationPlan" ) { found = true; break; } } Assert.IsTrue( found, "could not find OwnEquityInstrumentHeldEquityCompensationPlan " ); Assert.IsFalse( s.boundElements.ContainsKey("OwnEquityInstrumentHeldEquityCompensationPlan"), "OwnEquityInstrumentHeldEquityCompensationPlan found in boundElements" ); }
public void IFRS_ElementTaxonomyLinks() { //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) ); TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15(); int errors = 0; if ( s.Load( IFRS_FILE, out errors ) != true ) { Assert.Fail( (string)s.ErrorList[0]); } errors = 0; s.Parse( out errors ); s.currentLanguage = "en"; s.currentLabelRole = "label"; ArrayList nodes = s.GetNodesByElement(); Assert.AreEqual( 0, ((Node)nodes[0]).TaxonomyInfoId, "Taxonomy id not correct" ); TaxonomyItem ti = s.GetTaxonomyInfo( (Node)nodes[0] ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/2004-06-15", ti.WebLocation, "target namespace wrong" ); Assert.AreEqual( IFRS_FILE, ti.Location, "targetLocation wrong" ); }