Esempio n. 1
0
        public void LoadLocators()
        {
            TestPresentationLink pl = new TestPresentationLink("Statement of Financial Position - CI","http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition");

            int errors = 0;

            TestPresentation p = new TestPresentation();

            Console.WriteLine( "Using File {0}", GAAP_PRESENTATION_FILE );

            p.Load( GAAP_PRESENTATION_FILE);

            XmlNodeList pLinksList = p.TheDocument.SelectNodes( Presentation.PLINK_KEY, p.TheManager );

            if ( pLinksList == null || pLinksList.Count == 0 )
            {
                Assert.Fail( "no nodes returned" );
            }

            XmlNode plNode = pLinksList.Item(0);
            pl.LoadChildren( plNode, p.TheManager, out errors );

            Assert.AreEqual( 0, errors );
            Assert.AreEqual( 290, pl.locators.Count );

            //total count of prohibited mappings
            int count = 0;
            foreach ( PresentationLocator ploc in pl.locators.Values )
            {
                TestPresentationLocator tpl = new TestPresentationLocator( ploc );
                count += tpl.NumProhibited();
            }

            Assert.AreEqual( 8, count );
        }
Esempio n. 2
0
        /// <exclude/>
        [Test] public void VerifyXmlString()
        {
            TestPresentationLink pl = new TestPresentationLink("Statement of Financial Position - CI", "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition");

            int errors = 0;

            TestPresentation p = new TestPresentation();

            Console.WriteLine("Using File {0}", GAAP_PRESENTATION_FILE);

            p.Load(GAAP_PRESENTATION_FILE);

            XmlNodeList pLinksList = p.TheDocument.SelectNodes(Presentation.PLINK_KEY, p.TheManager);

            if (pLinksList == null || pLinksList.Count == 0)
            {
                Assert.Fail("no nodes returned");
            }

            XmlNode plNode = pLinksList.Item(0);

            pl.LoadChildren(plNode, p.TheManager, out errors);

            Assert.AreEqual(0, errors);

            string xml = pl.ToXmlString();

            //Console.WriteLine( xml );

            XmlDocument doc = new XmlDocument();

            //XmlDocumentFragment frag = doc.CreateDocumentFragment();
            doc.LoadXml(xml);
        }
Esempio n. 3
0
        public void LoadLocators()
        {
            TestPresentationLink pl = new TestPresentationLink("Statement of Financial Position - CI", "http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition");

            int errors = 0;

            TestPresentation p = new TestPresentation();

            Console.WriteLine("Using File {0}", GAAP_PRESENTATION_FILE);

            p.Load(GAAP_PRESENTATION_FILE);

            XmlNodeList pLinksList = p.TheDocument.SelectNodes(Presentation.PLINK_KEY, p.TheManager);

            if (pLinksList == null || pLinksList.Count == 0)
            {
                Assert.Fail("no nodes returned");
            }

            XmlNode plNode = pLinksList.Item(0);

            pl.LoadChildren(plNode, p.TheManager, out errors);

            Assert.AreEqual(0, errors);
            Assert.AreEqual(290, pl.locators.Count);

            //total count of prohibited mappings
            int count = 0;

            foreach (PresentationLocator ploc in pl.locators.Values)
            {
                TestPresentationLocator tpl = new TestPresentationLocator(ploc);
                count += tpl.NumProhibited();
            }


            Assert.AreEqual(8, count);
        }
Esempio n. 4
0
        public void VerifyXmlString()
        {
            TestPresentationLink pl = new TestPresentationLink("Statement of Financial Position - CI","http://www.xbrl.org/taxonomy/us/fr/gaap/role/StatementFinancialPosition");

            int errors = 0;

            TestPresentation p = new TestPresentation();

            Console.WriteLine( "Using File {0}", GAAP_PRESENTATION_FILE );

            p.Load( GAAP_PRESENTATION_FILE);

            XmlNodeList pLinksList = p.TheDocument.SelectNodes( Presentation.PLINK_KEY, p.TheManager );

            if ( pLinksList == null || pLinksList.Count == 0 )
            {
                Assert.Fail( "no nodes returned" );
            }

            XmlNode plNode = pLinksList.Item(0);
            pl.LoadChildren( plNode, p.TheManager, out errors );

            Assert.AreEqual( 0, errors );

            string xml = pl.ToXmlString();

            //Console.WriteLine( xml );

            XmlDocument doc = new XmlDocument();
            //XmlDocumentFragment frag = doc.CreateDocumentFragment();
            doc.LoadXml( xml );
        }