public void Test_LoadRoleTypes()
        {
            TestTaxonomy_IFRS_2004_06_15 s = new TestTaxonomy_IFRS_2004_06_15();

            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] );
        }
示例#2
0
        public void Test_LoadRoleTypes()
        {
            TestSchema s = new TestSchema();

            ErrorInfo ei = null;

            if ( !s.Load( US_GAAP_FILE, out ei ) )
            {
                Assert.IsNotNull( ei );
                Assert.Fail( ei.ExceptionMsg );
            }

            Assert.IsNull( ei );

            int errors = 0;
            s.LoadRoleTypes( out errors );
            Assert.AreEqual( 0, errors );

            Assert.AreEqual( 6, s.roleTypes.Count );

            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation" ) );

            RoleType t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement"] as RoleType;
            TestRoleType rt = new TestRoleType( t );

            Assert.IsNotNull( rt );

            Assert.AreEqual( "IncomeStatement", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // StatementFinancialPosition
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "StatementFinancialPosition", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // StatementCashFlowsIndirect
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "StatementCashFlowsIndirect", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // StatementCashFlowsDirect
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "StatementCashFlowsDirect", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // StatementStockholdersEquity
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "StatementStockholdersEquity", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // TotalStockholdersEquityCalculation
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "TotalStockholdersEquityCalculation", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation", rt.Uri );
            Assert.AreEqual( 1, rt.WhereUsed.Count );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[0] );
        }
示例#3
0
        [Test] public void Test_LoadRoleTypes()
        {
            TestSchema s = new TestSchema();

            ErrorInfo ei = null;

            if (!s.Load(US_GAAP_FILE, out ei))
            {
                Assert.IsNotNull(ei);
                Assert.Fail(ei.ExceptionMsg);
            }

            Assert.IsNull(ei);

            int errors = 0;

            s.LoadRoleTypes(out errors);
            Assert.AreEqual(0, errors);

            Assert.AreEqual(6, s.roleTypes.Count);

            Assert.IsTrue(s.roleTypes.ContainsKey("http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement"));
            Assert.IsTrue(s.roleTypes.ContainsKey("http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition"));
            Assert.IsTrue(s.roleTypes.ContainsKey("http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect"));
            Assert.IsTrue(s.roleTypes.ContainsKey("http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect"));
            Assert.IsTrue(s.roleTypes.ContainsKey("http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity"));
            Assert.IsTrue(s.roleTypes.ContainsKey("http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation"));

            RoleType     t  = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement"] as RoleType;
            TestRoleType rt = new TestRoleType(t);

            Assert.IsNotNull(rt);

            Assert.AreEqual("IncomeStatement", rt.Id);
            Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement", rt.Uri);
            Assert.AreEqual(2, rt.WhereUsed.Count);
            Assert.AreEqual("link:presentationLink", rt.WhereUsed[0]);
            Assert.AreEqual("link:calculationLink", rt.WhereUsed[1]);

            // StatementFinancialPosition
            t  = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition"] as RoleType;
            rt = new TestRoleType(t);
            Assert.IsNotNull(rt);

            Assert.AreEqual("StatementFinancialPosition", rt.Id);
            Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition", rt.Uri);
            Assert.AreEqual(2, rt.WhereUsed.Count);
            Assert.AreEqual("link:presentationLink", rt.WhereUsed[0]);
            Assert.AreEqual("link:calculationLink", rt.WhereUsed[1]);

            // StatementCashFlowsIndirect
            t  = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect"] as RoleType;
            rt = new TestRoleType(t);
            Assert.IsNotNull(rt);

            Assert.AreEqual("StatementCashFlowsIndirect", rt.Id);
            Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect", rt.Uri);
            Assert.AreEqual(2, rt.WhereUsed.Count);
            Assert.AreEqual("link:presentationLink", rt.WhereUsed[0]);
            Assert.AreEqual("link:calculationLink", rt.WhereUsed[1]);

            // StatementCashFlowsDirect
            t  = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect"] as RoleType;
            rt = new TestRoleType(t);
            Assert.IsNotNull(rt);

            Assert.AreEqual("StatementCashFlowsDirect", rt.Id);
            Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect", rt.Uri);
            Assert.AreEqual(2, rt.WhereUsed.Count);
            Assert.AreEqual("link:presentationLink", rt.WhereUsed[0]);
            Assert.AreEqual("link:calculationLink", rt.WhereUsed[1]);

            // StatementStockholdersEquity
            t  = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity"] as RoleType;
            rt = new TestRoleType(t);
            Assert.IsNotNull(rt);

            Assert.AreEqual("StatementStockholdersEquity", rt.Id);
            Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity", rt.Uri);
            Assert.AreEqual(2, rt.WhereUsed.Count);
            Assert.AreEqual("link:presentationLink", rt.WhereUsed[0]);
            Assert.AreEqual("link:calculationLink", rt.WhereUsed[1]);

            // TotalStockholdersEquityCalculation
            t  = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation"] as RoleType;
            rt = new TestRoleType(t);
            Assert.IsNotNull(rt);

            Assert.AreEqual("TotalStockholdersEquityCalculation", rt.Id);
            Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation", rt.Uri);
            Assert.AreEqual(1, rt.WhereUsed.Count);
            Assert.AreEqual("link:calculationLink", rt.WhereUsed[0]);
        }
        public void Test_LoadRoleTypes()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            s.Load( US_GAAP_FILE );

            int errors = 0;
            s.LoadRoleTypes( out errors );
            Assert.AreEqual( 0, errors );

            Assert.AreEqual( 7, s.roleTypes.Count );

            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/Notes" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity" ) );
            Assert.IsTrue( s.roleTypes.ContainsKey( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation" ) );

            RoleType t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement"] as RoleType;
            TestRoleType rt = new TestRoleType( t );

            Assert.IsNotNull( rt );

            Assert.AreEqual( "IncomeStatement", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/IncomeStatement", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // StatementFinancialPosition
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "StatementFinancialPosition", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // StatementCashFlowsIndirect
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "StatementCashFlowsIndirect", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsIndirect", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // StatementCashFlowsDirect
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "StatementCashFlowsDirect", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementCashFlowsDirect", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // StatementStockholdersEquity
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "StatementStockholdersEquity", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementStockholdersEquity", rt.Uri );
            Assert.AreEqual( 2, rt.WhereUsed.Count );
            Assert.AreEqual( "link:presentationLink", rt.WhereUsed[0] );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[1] );

            // TotalStockholdersEquityCalculation
            t = s.roleTypes["http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation"] as RoleType;
            rt = new TestRoleType( t );
            Assert.IsNotNull( rt );

            Assert.AreEqual( "TotalStockholdersEquityCalculation", rt.Id );
            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/role/TotalStockholdersEquityCalculation", rt.Uri );
            Assert.AreEqual( 1, rt.WhereUsed.Count );
            Assert.AreEqual( "link:calculationLink", rt.WhereUsed[0] );
        }