public void IFRS_VerifyPresentationTypes() { TestTaxonomy_IFRS s = new TestTaxonomy_IFRS(); int errors = 0; if ( s.Load( IFRS_FILE, out errors ) != true ) { Assert.Fail( (string)s.ErrorList[0]); } errors = 0; //s.TestParse( out errors ); //Assert.AreEqual( 22, errors, "parse failed" ); s.LoadRoleTypes( out errors ); Assert.AreEqual( 0, errors, "load role types returned the wrong number of errors" ); errors = 0; Presentation p = s.LoadPresentationSchema( out errors ); if ( errors > 0 ) { SendErrorsToConsole( p.ErrorList ); } Assert.AreEqual(0, errors, "presentation schema failed" ); // PROBLEM with us-IFRS-ci-2004-08-15-presentation.xml ? Assert.IsNotNull( p ); p.ErrorList.Clear(); if ( s.VerifyPresentationTypes( p, out errors ) == false ) { if ( errors > 0 ) { SendErrorsToConsole( s.ErrorList ); } Assert.Fail( "There are " + errors + " failures in the VerifyPresentationTypes call" ); } }
public void Test_LoadRoleTypes() { TestTaxonomy_IFRS s = new TestTaxonomy_IFRS(); s.Load( IFRS_FILE ); int errors = 0; s.LoadRoleTypes( out errors ); Assert.AreEqual( 0, errors ); Assert.AreEqual( 15, s.roleTypes.Count, s.roleTypes.Count.ToString() + " found. expected 15" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/2003/frta/role/restated" ), "http://www.xbrl.org/2003/frta/role/restated not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetClassified" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetClassified not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetLiquidity" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetLiquidity not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetNetAssets" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetNetAssets not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/IncomeStatementByFunction" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/IncomeStatementByFunction not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/IncomeStatementByNature" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/IncomeStatementByNature not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CashFlowsDirect" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CashFlowsDirect not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CashFlowsIndirect" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CashFlowsIndirect not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/Equity" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/Equity not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/AccountingPolicies" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/AccountingPolicies not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/ExplanatoryDisclosures" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/ExplanatoryDisclosures not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/Classes" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/Classes not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CurrentNonCurrent" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CurrentNonCurrent not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/NetGross" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/NetGross not found" ); Assert.IsTrue( s.roleTypes.ContainsKey( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/TypeEnumerations" ), "http://xbrl.iasb.org/int/fr/ifrs/gp/role/TypeEnumerations not found" ); RoleType t = s.roleTypes["http://www.xbrl.org/2003/frta/role/restated"] as RoleType; TestRoleType rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "restated", rt.Id ); Assert.AreEqual( "http://www.xbrl.org/2003/frta/role/restated", rt.Uri ); Assert.AreEqual( string.Empty, rt.Definition ); Assert.AreEqual( 1, rt.WhereUsed.Count ); Assert.AreEqual( "link:label", rt.WhereUsed[0] ); // BalanceSheetClassified t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetClassified"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "BalanceSheetClassified", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetClassified", rt.Uri ); Assert.AreEqual( "Balance Sheet, Classified Format", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // BalanceSheetLiquidity t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetLiquidity"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "BalanceSheetLiquidity", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetLiquidity", rt.Uri ); Assert.AreEqual( "Balance Sheet, Order of Liquidity Format", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // BalanceSheetNetAssets t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetNetAssets"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "BalanceSheetNetAssets", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/BalanceSheetNetAssets", rt.Uri ); Assert.AreEqual( "Balance Sheet, Net Assets Format", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // IncomeStatementByFunction t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/IncomeStatementByFunction"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "IncomeStatementByFunction", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/IncomeStatementByFunction", rt.Uri ); Assert.AreEqual( "Income Statement, By Function Format", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // IncomeStatementByNature t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/IncomeStatementByNature"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "IncomeStatementByNature", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/IncomeStatementByNature", rt.Uri ); Assert.AreEqual( "Income Statement, By Nature Format", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // CashFlowsDirect t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/CashFlowsDirect"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "CashFlowsDirect", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CashFlowsDirect", rt.Uri ); Assert.AreEqual( "Cash Flows, Direct Method", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // CashFlowsIndirect t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/CashFlowsIndirect"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "CashFlowsIndirect", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CashFlowsIndirect", rt.Uri ); Assert.AreEqual( "Cash Flows, Indirect Method", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // Equity t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/Equity"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "Equity", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/Equity", rt.Uri ); Assert.AreEqual( "Statement of Changes in Equity", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // AccountingPolicies t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/AccountingPolicies"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "AccountingPolicies", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/AccountingPolicies", rt.Uri ); Assert.AreEqual( "Accounting Policies", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // ExplanatoryDisclosures t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/ExplanatoryDisclosures"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "ExplanatoryDisclosures", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/ExplanatoryDisclosures", rt.Uri ); Assert.AreEqual( "Explanatory Disclosures", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // Classes t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/Classes"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "Classes", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/Classes", rt.Uri ); Assert.AreEqual( "Classes", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // CurrentNonCurrent t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/CurrentNonCurrent"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "CurrentNonCurrent", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/CurrentNonCurrent", rt.Uri ); Assert.AreEqual( "Current/Non Current Breakdown", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // NetGross t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/NetGross"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "NetGross", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/NetGross", rt.Uri ); Assert.AreEqual( "Net/Gross Breakdown", rt.Definition ); Assert.AreEqual( 2, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] ); // NetGross t = s.roleTypes["http://xbrl.iasb.org/int/fr/ifrs/gp/role/TypeEnumerations"] as RoleType; rt = new TestRoleType( t ); Assert.IsNotNull( rt ); Assert.AreEqual( "TypeEnumerations", rt.Id ); Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/role/TypeEnumerations", rt.Uri ); Assert.AreEqual( "Type Enumerations", rt.Definition ); Assert.AreEqual( 1, rt.WhereUsed.Count ); Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] ); }