Ejemplo n.º 1
0
        public void TestLoadInlineXBRLDocument1()
        {
            string       fileName = @"R:\Liberty Global\20080331\XBRLUSGAAPTaxonomies-2008-03-31\XBRLUSGAAPTaxonomies-2008-03-31\ind\ci\testing.xml";
            TestInstance ins1     = new TestInstance();
            ArrayList    errors   = new ArrayList();

            Assert.IsTrue(ins1.TryLoadInstanceDoc(fileName, out errors), "Instance document load should succeed");
            fileName = @"R:\Liberty Global\20080331\XBRLUSGAAPTaxonomies-2008-03-31\XBRLUSGAAPTaxonomies-2008-03-31\ind\ci\testing.html";
            TestInstance ins2 = new TestInstance();

            errors = new ArrayList();
            Assert.IsTrue(ins2.TryLoadInstanceDoc(fileName, out errors), "Instance document load should succeed");

            ins1.markups.Sort();

            ArrayList uniqueMarkups = new ArrayList();

            foreach (MarkupProperty mp in ins2.markups)
            {
                int index = ins1.markups.BinarySearch(mp);
                if (index < 0)
                {
                    Console.WriteLine("Found markup not in xbrl ");
                }
            }

            Assert.AreEqual(ins1.markups.Count, ins2.markups.Count, "should have the same markups ");
            Assert.AreEqual(ins1.contexts.Count, ins2.contexts.Count, "should have the same contexts ");
            Assert.AreEqual(ins1.units.Count, ins2.units.Count, "should have the same contexts ");

            ins1.markups.Sort();
            ins2.markups.Sort();

            for (int i = 0; i < ins1.markups.Count; i++)
            {
                MarkupProperty mp1 = ins1.markups[i] as MarkupProperty;
                MarkupProperty mp2 = ins2.markups[i] as MarkupProperty;

                if (mp1.CompareTo(mp2) != 0)
                {
                    Assert.Fail("Markups are not equal " + i.ToString());
                }
            }
        }
Ejemplo n.º 2
0
        public void TestLoadInlineXBRLDocument1()
        {
            string fileName = @"R:\Liberty Global\20080331\XBRLUSGAAPTaxonomies-2008-03-31\XBRLUSGAAPTaxonomies-2008-03-31\ind\ci\testing.xml";
            TestInstance ins1 = new TestInstance();
            ArrayList errors = new ArrayList();
            Assert.IsTrue(ins1.TryLoadInstanceDoc(fileName, out errors), "Instance document load should succeed");
            fileName = @"R:\Liberty Global\20080331\XBRLUSGAAPTaxonomies-2008-03-31\XBRLUSGAAPTaxonomies-2008-03-31\ind\ci\testing.html";
            TestInstance ins2 = new TestInstance();
            errors = new ArrayList();
            Assert.IsTrue(ins2.TryLoadInstanceDoc(fileName, out errors), "Instance document load should succeed");

            ins1.markups.Sort();

            ArrayList uniqueMarkups = new ArrayList();
            foreach (MarkupProperty mp in ins2.markups)
            {
                int index = ins1.markups.BinarySearch(mp);
                if (index < 0)
                {
                    Console.WriteLine("Found markup not in xbrl ");
                }
            }

            Assert.AreEqual(ins1.markups.Count, ins2.markups.Count, "should have the same markups ");
            Assert.AreEqual(ins1.contexts.Count, ins2.contexts.Count, "should have the same contexts ");
            Assert.AreEqual(ins1.units.Count, ins2.units.Count, "should have the same contexts ");

            ins1.markups.Sort();
            ins2.markups.Sort();

            for (int i = 0; i < ins1.markups.Count; i++)
            {
                MarkupProperty mp1 = ins1.markups[i] as MarkupProperty;
                MarkupProperty mp2 = ins2.markups[i] as MarkupProperty;

                if (mp1.CompareTo(mp2) != 0)
                {
                    Assert.Fail("Markups are not equal " + i.ToString());
                }
            }
        }
Ejemplo n.º 3
0
        public void TestReadBrazilianPetroInstanceWithFootnotes()
        {
            TestInstance ins = new TestInstance();
            ArrayList errors = new ArrayList();
            Assert.IsTrue(ins.TryLoadInstanceDoc(@"S:\TestSchemas\BPC\pbra-20061231.xml", out errors), "Instance document load should succeed");

            Assert.AreEqual(1, ins.fnProperties.Count, "should have 6 footnotes");
            int count = 0;
            int mpWithfootNoteCount = 0;
            foreach (MarkupProperty mp in ins.markups)
            {
                if (mp.Id != null)
                {
                    mpWithfootNoteCount++;
                }

                if (mp.Id != null && mp.Id.Equals("id_footnote_elem_6276445"))
                {
                    count++;
                    Assert.IsTrue(mp.Links.Count > 0, "count should be greater than zero");

                    foreach (FootnoteProperty fp in mp.Links)
                    {
                        Console.WriteLine(fp.markupData);
                    }

                }
            }

            Assert.IsTrue(mpWithfootNoteCount == 6, "count should be gequal to 6");
            Assert.IsTrue(count > 0, "count should be greater than zero");
        }
Ejemplo n.º 4
0
        public void TestLoadInlineXBRLDocument()
        {
            string fileName = @"S:\TestSchemas\INLINEXBRL\msft-20080331.xml";
            TestInstance ins = new TestInstance();
            ArrayList errors = new ArrayList();
            Assert.IsTrue(ins.TryLoadInstanceDoc(fileName, out errors), "Instance document load should succeed");

            Assert.AreEqual(700, ins.markups.Count, "Should have 700 markups");
        }