コード例 #1
0
        [Test] public void PT_VerifyPresentationTypes()
        {
            TestSchema s = new TestSchema();

            ErrorInfo ei = null;

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

            int errors = 0;

            s.LoadRoleTypes(out errors);
            //s.TestParse( out errors );
            Assert.AreEqual(0, errors, "load role types failure");

            Presentation p = s.LoadPresentationSchema(out errors);

            Assert.AreEqual(4, errors);
            Assert.IsNotNull(p);

            if (s.VerifyPresentationTypes(p, out errors) == false)
            {
                Assert.Fail("There are " + errors + " failures in the VerifyPresentationTypes call");
            }
        }
コード例 #2
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]);
        }
コード例 #3
0
ファイル: TestSchema.cs プロジェクト: plamikcho/xbrlpoc
        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] );
        }
コード例 #4
0
ファイル: TestSchema.cs プロジェクト: plamikcho/xbrlpoc
        public void PT_VerifyPresentationTypes()
        {
            TestSchema s = new TestSchema();

            ErrorInfo ei = null;

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

            int errors = 0;

            s.LoadRoleTypes( out errors );
            //s.TestParse( out errors );
            Assert.AreEqual( 0, errors, "load role types failure" );

            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.AreEqual(4, errors );
            Assert.IsNotNull( p );

            if ( s.VerifyPresentationTypes( p, out errors ) == false )
            {
                Assert.Fail( "There are " + errors + " failures in the VerifyPresentationTypes call" );
            }
        }