Esempio n. 1
0
        [Test] public void ifrs_Test_VerifyTuples()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.CurrentLabelRole = "label";
            s.CurrentLanguage  = "en";

            s.Load(IFRS_FILE);

            int errors = 0;

            s.Parse(out errors);

            ArrayList nodeList = s.GetNodesByElement();

            Assert.IsNotNull(nodeList);
            Assert.AreEqual(2591, nodeList.Count);

            Console.WriteLine("Found Tuple Nodes: ");

            foreach (Node n in nodeList)
            {
                RecurseVerifyTuples(n);
            }
        }
Esempio n. 2
0
        [Test] public void GAAP_VerifyPresentationTypes()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if (s.Load(US_GAAP_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);

            Assert.AreEqual(22, errors, "presentation schema failed");
            Assert.IsNotNull(p);

            if (s.VerifyPresentationTypes(p, out errors) == false)
            {
                Assert.Fail("There are " + errors + " failures in the VerifyPresentationTypes call");
            }
        }
Esempio n. 3
0
        [Test] public void ifrs_Parse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            DateTime start = DateTime.Now;

            if (s.Load(IFRS_FILE, out errors) != true)
            {
                Assert.Fail((string)s.ErrorList[0]);
            }

            errors = 0;
            s.Parse(out errors);
            DateTime end = DateTime.Now;

            Console.WriteLine("Parse Time: {0}", end - start);

            TimeSpan level = new TimeSpan(0, 0, 0, 10, 0);                      // 10 seconds to parse

            Assert.IsTrue(level > (end - start), "Parse takes too long");

            PresentationLink pl = s.presentationInfo["Accounting Policies"] as PresentationLink;

            Assert.IsNotNull(pl);
        }
Esempio n. 4
0
        [Test] public void ifrs_LoadImports()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if (s.Load(IFRS_FILE, out errors) == false)
            {
                Assert.Fail((string)s.ErrorList[0]);
            }

            errors = 0;
            s.LoadPresentation(out errors);
            Assert.AreEqual(144, errors, "wrong number of load presentation errors");

            errors = 0;
            s.LoadElements(out errors);
            Assert.AreEqual(5, errors, "wrong number of load element errors");

            errors = 0;
            s.LoadImports(out errors);
            Assert.AreEqual(0, errors, "wrong number of load import errors");

            // accounting policies is defined in the usfr-pt schema
            Assert.IsTrue(s.allElements.ContainsKey("OtherLiabilitiesPolicy"));

            //Trace.Listeners.Clear();
        }
Esempio n. 5
0
        [Test] public void GAAP_LoadImportsAndBind()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if (s.Load(US_GAAP_FILE, out errors) == false)
            {
                Assert.Fail((string)s.ErrorList[0]);
            }

            errors = 0;
            s.LoadPresentation(out errors);
            Assert.AreEqual(22, errors, "wrong number of load presentation errors");

            errors = 0;
            s.LoadElements(out errors);
            Assert.AreEqual(0, errors, "wrong number of load element errors");

            errors = 0;
            s.LoadImports(out errors);
            Assert.AreEqual(5, errors, "wrong number of load import errors");                   // 5 ci elements are duplicated in the usfr-pt schema

            errors = 0;
            s.BindElements(new BindElementDelegate(s.BindElementToLocator), out errors);
            Assert.AreEqual(690, errors, "wrong number of bind errors");

            // accounting policies is defined in the usfr-pt schema
            Assert.IsTrue(s.allElements.ContainsKey("AccountingPolicies"));

            //Trace.Listeners.Clear();
        }
Esempio n. 6
0
        [Test][Ignore("Just used to view nodes")] public void GAAP_Test_GetNodesByElement()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.CurrentLabelRole = "label";
            s.CurrentLanguage  = "en";

            s.Load(US_GAAP_FILE);

            int errors = 0;

            s.Parse(out errors);

            ArrayList nodeList = s.GetNodesByElement();

            Assert.IsNotNull(nodeList);
            Assert.AreEqual(1367, nodeList.Count);

            Console.WriteLine("Nodes By Element: ");

            foreach (Node n in nodeList)
            {
                Console.WriteLine(TestNode.ToXml(0, n));
            }
        }
Esempio n. 7
0
        [Test] public void GAAP_LoadSchema()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            Assert.AreEqual(true, s.Load(US_GAAP_FILE, out errors), "Could not load US GAAP File");
        }
Esempio n. 8
0
        [Test] public void GAAP_TargetNamespace()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(US_GAAP_FILE);

            s.GetTargetNamespace();

            Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/gaap/ci/us-gaap-ci-2004-06-15", s.targetNamespace);
        }
Esempio n. 9
0
        [Test][Ignore("Worry about this later")] public void SAG_TargetNamespace()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(SAG_FILE);

            s.GetTargetNamespace();

            Assert.IsNull(s.targetNamespace);
        }
Esempio n. 10
0
        [Test] public void PT_TargetNamespace()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(PT_GAAP_FILE);

            s.GetTargetNamespace();

            Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/common/pt/usfr-pt-2004-06-15", s.targetNamespace);
        }
Esempio n. 11
0
        [Test] public void ifrs_TargetNamespace()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(IFRS_FILE);

            s.GetTargetNamespace();

            Assert.AreEqual("http://xbrl.iasb.org/int/fr/ifrs/gp/2004-06-15", s.targetNamespace);
        }
Esempio n. 12
0
        [Test][Ignore("do this later")] public void SAG_GetLinkbaseRef_Presentation()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(SAG_FILE);

            string labelRef = s.GetLinkbaseReference(TestTaxonomy_2004_06_15.TARGET_LINKBASE_URI + TestTaxonomy_2004_06_15.PRESENTATION_ROLE);

            Assert.AreEqual("blue", labelRef);
        }
Esempio n. 13
0
        [Test] public void PT_Parse()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(PT_GAAP_FILE);

            int errors = 0;

            s.Parse(out errors);

            Assert.AreEqual(1898, errors);
        }
Esempio n. 14
0
        [Test] public void PT_LoadPresentationSchema()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(PT_GAAP_FILE);

            int          errors = 0;
            Presentation p      = s.LoadPresentationSchema(out errors);

            Assert.IsNotNull(p);
            Assert.AreEqual(4, errors);
        }
Esempio n. 15
0
        [Test] public void ifrs_ReadElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            s.Load(IFRS_FILE);

            int numElements = s.LoadElements(out errors);

            Assert.AreEqual(5, errors);
            Assert.AreEqual(2591, s.allElements.Count);
        }
Esempio n. 16
0
        [Test] public void PT_LoadLabels()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(PT_GAAP_FILE);

            int errors = 0;

            s.LoadLabels(out errors);

            Assert.AreEqual(0, errors);
            Assert.AreEqual(1478, s.labelTable.Count);
        }
Esempio n. 17
0
        [Test] public void GAAP_GetSupportedLanguages()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(US_GAAP_FILE);

            int       errors = 0;
            ArrayList langs  = s.GetSupportedLanguages(false, out errors);

            Assert.AreEqual(0, errors);
            Assert.AreEqual(1, langs.Count);
            Assert.AreEqual("en", langs[0]);
        }
Esempio n. 18
0
        [Test] public void GAAP_ReadElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            s.Load(US_GAAP_FILE);

            int numElements = s.LoadElements(out errors);

            Assert.AreEqual(0, errors);
            Assert.AreEqual(5, s.allElements.Count);
        }
Esempio n. 19
0
        [Test] public void PT_GetLinkbaseRef_Presentation()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(PT_GAAP_FILE);

            string presRef = s.GetLinkbaseReference(TestTaxonomy_2004_06_15.TARGET_LINKBASE_URI + TestTaxonomy_2004_06_15.PRESENTATION_ROLE);

#if AUTOMATED
            Assert.AreEqual(@"q:\MAX\axe\XBRLParser\TestSchemas\XBRL 2.1 Updated\2004-06-15\usfr-pt-2004-06-15-presentation.xml", presRef);
#else
            Assert.AreEqual(@"c:\Aucent\MAX\axe\XBRLParser\TestSchemas\XBRL 2.1 Updated\2004-06-15\usfr-pt-2004-06-15-presentation.xml", presRef);
#endif
        }
Esempio n. 20
0
        [Test] public void ifrs_GetLinkbaseRef_Presentation()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            Assert.AreEqual(true, s.Load(IFRS_FILE, out errors), "Could not load US IFRS File");

            string presRef = s.GetLinkbaseReference(TestTaxonomy_2004_06_15.TARGET_LINKBASE_URI + TestTaxonomy_2004_06_15.PRESENTATION_ROLE);

#if AUTOMATED
            Assert.AreEqual(@"q:\MAX\axe\XBRLParser\TestSchemas\ifrs\ifrs-gp-2004-06-15-presentation.xml", presRef);
#else
            Assert.AreEqual(@"C:\AUCENT\MAX\AXE\XBRLParser\TestSchemas\ifrs\ifrs-gp-2004-06-15-presentation.xml", presRef);
#endif
        }
Esempio n. 21
0
        [Test] public void PT_ReadElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(PT_GAAP_FILE);

            int          errors = 0;
            Presentation p      = s.LoadPresentationSchema(out errors);

            Assert.AreEqual(4, errors, "load presentation failed");

            s.presentationInfo = p.PresentationLinks;

            s.LoadElements(out errors);
            Assert.AreEqual(0, errors, "load elements failed");
        }
Esempio n. 22
0
        [Test] public void GAAP_GetLinkbaseRef_Presentation()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            Assert.AreEqual(true, s.Load(US_GAAP_FILE, out errors), "Could not load US GAAP File");

            string presRef = s.GetLinkbaseReference(TestTaxonomy_2004_06_15.TARGET_LINKBASE_URI + TestTaxonomy_2004_06_15.PRESENTATION_ROLE);

#if AUTOMATED
            Assert.AreEqual(@"q:\MAX\axe\XBRLParser\TestSchemas\XBRL 2.1 Updated\2004-06-15\us-gaap-ci-2004-06-15-presentation.xml", presRef);
#else
            Assert.AreEqual(@"c:\Aucent\MAX\axe\XBRLParser\TestSchemas\XBRL 2.1 Updated\2004-06-15\us-gaap-ci-2004-06-15-presentation.xml", presRef);
#endif
        }
Esempio n. 23
0
        [Test][Ignore("Takes a while")] public void ifrs_OutputTaxonomy()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(IFRS_FILE);

            int errors = 0;

            s.Parse(out errors);

#if !AUTOMATED
            using (StreamWriter sw = new StreamWriter(US_OUT_FILE))
            {
                sw.Write(s.ToXmlString());
            }
#endif
        }
Esempio n. 24
0
        [Test] public void ifrs_GetLabelRoles()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(IFRS_FILE);

            int       errors = 0;
            ArrayList roles  = s.GetLabelRoles(false, out errors);

            Assert.AreEqual(0, errors);
            Assert.AreEqual(5, roles.Count);
            Assert.AreEqual("documentation", roles[0]);
            Assert.AreEqual("label", roles[1]);
            Assert.AreEqual("periodEndLabel", roles[2]);
            Assert.AreEqual("periodStartLabel", roles[3]);
            Assert.AreEqual("restated", roles[4]);
        }
Esempio n. 25
0
        [Test] public void GAAP_LoadPresentationSchema()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if (s.Load(US_GAAP_FILE, out errors) != true)
            {
                Assert.Fail((string)s.ErrorList[0]);
            }

            errors = 0;
            Presentation p = s.LoadPresentationSchema(out errors);

            Assert.IsNotNull(p);
            Assert.AreEqual(22, errors);
        }
Esempio n. 26
0
        [Test][Ignore("Superceded by GAAP_OutputTaxonomy")] public void PT_OutputTaxonomy()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(PT_GAAP_FILE);

            int errors = 0;

            s.Parse(out errors);

#if !AUTOMATED
            using (StreamWriter sw = new StreamWriter(PT_OUT_FILE))
            {
                sw.Write(s.ToXmlString());
            }
#endif
        }
Esempio n. 27
0
        [Test] public void GAAP_Parse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            DateTime start = DateTime.Now;

            if (s.Load(US_GAAP_FILE, out errors) != true)
            {
                Assert.Fail((string)s.ErrorList[0]);
            }

            errors = 0;
            s.Parse(out errors);
            DateTime end = DateTime.Now;

            Console.WriteLine("Parse Time: {0}", end - start);

            TimeSpan level = new TimeSpan(0, 0, 0, 4, 0);               // 4 seconds to parse

            Assert.IsTrue(level > (end - start), "Parse takes too long");

            PresentationLink pl = s.presentationInfo["Statement of Cash Flows - Direct Method - CI"] as PresentationLink;

            Assert.IsNotNull(pl);

            PresentationLocator ploc = null;

            Assert.IsTrue(pl.TryGetLocator("usfr-pt_NetIncreaseDecreaseCashCashEquivalents", out ploc));

            Assert.AreEqual(22 + 690 + 5 + 4 + 5 + 953 + 1474, errors, "parse failure");

            // 22 = presentation load errors
            // 690 = bind failures - elements w/o presentation
            // 5 = imports - 5 duplicate elements
            // 4 = duplicate labels
            // 5 = elements without matching labels
            // 953 = elements without ref
            // 1474 = element without calc

            //Trace.Listeners.Clear();
        }
Esempio n. 28
0
        public void GAAP_GetLabelRoles()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( US_GAAP_FILE );

            int errors = 0;
            ArrayList roles = s.GetLabelRoles( false, out errors );

            Assert.AreEqual( 0, errors );
            Assert.AreEqual( 6, roles.Count );
            Assert.AreEqual( "documentation", roles[0] );
            Assert.AreEqual( "label", roles[1] );
            Assert.AreEqual( "periodEndLabel", roles[2] );
            Assert.AreEqual( "periodStartLabel", roles[3] );
            Assert.AreEqual( "terseLabel", roles[4] );
            Assert.AreEqual( "totalLabel", roles[5] );
        }
Esempio n. 29
0
        [Test] public void GAAP_GetLabelRoles()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load(US_GAAP_FILE);

            int       errors = 0;
            ArrayList roles  = s.GetLabelRoles(false, out errors);

            Assert.AreEqual(0, errors);
            Assert.AreEqual(6, roles.Count);
            Assert.AreEqual("documentation", roles[0]);
            Assert.AreEqual("label", roles[1]);
            Assert.AreEqual("periodEndLabel", roles[2]);
            Assert.AreEqual("periodStartLabel", roles[3]);
            Assert.AreEqual("terseLabel", roles[4]);
            Assert.AreEqual("totalLabel", roles[5]);
        }
Esempio n. 30
0
        [Test] public void ifrs_GetDependantTaxonomies()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if (!s.Load(IFRS_FILE, out errors))
            {
                Assert.Fail((string)s.ErrorList[0]);
            }

            errors = 0;
            ArrayList imps = s.GetDependantTaxonomies(false, out errors);

            Assert.AreEqual(0, errors, "error list not 0");

            Assert.AreEqual(0, imps.Count, "wrong number of imports returned");
        }
Esempio n. 31
0
        [Test] public void GAAP_TestTuples()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            s.Load(US_GAAP_FILE);

            s.Parse(out errors);

            IDictionaryEnumerator enumer = s.allElements.GetEnumerator();

            Console.WriteLine("Found Tuple Elements: ");

            while (enumer.MoveNext())
            {
                RecurseElementsForTuples(enumer.Value as Element);
            }
        }
Esempio n. 32
0
        public void GAAP_BindElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            s.Load( US_GAAP_FILE );

            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.AreEqual( 22, errors, "load presentation failed" );

            s.presentationInfo = p.PresentationLinks;

            s.LoadElements( out errors );

            Assert.AreEqual( 0, errors, "load elements failed" );

            s.BindElements( new BindElementDelegate( s.BindElementToLocator ), out errors );

            Assert.AreEqual( 5, errors, "bind elements failed" );
        }
Esempio n. 33
0
        public void GAAP_GetDependantTaxonomies()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if ( !s.Load( US_GAAP_FILE, out errors ) )
            {
                Assert.Fail( (string)s.ErrorList[0]);
            }

            errors = 0;
            ArrayList imps = s.GetDependantTaxonomies( false, out errors );
            Assert.AreEqual( 0, errors, "error list not 0" );

            Assert.AreEqual( 1, imps.Count, "wrong number of imports returned" );

            #if AUTOMATED
            Assert.AreEqual( @"q:\MAX\axe\XBRLParser\TestSchemas\XBRL 2.1 Updated\2004-06-15\usfr-pt-2004-06-15.xsd", imps[0] );
            #else
            Assert.AreEqual( @"c:\Aucent\MAX\axe\XBRLParser\TestSchemas\XBRL 2.1 Updated\2004-06-15\usfr-pt-2004-06-15.xsd", imps[0] );
            #endif
        }
Esempio n. 34
0
        public void SAG_GetLinkbaseRef_Presentation()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( SAG_FILE);

            string labelRef = s.GetLinkbaseReference( TestTaxonomy_2004_06_15.TARGET_LINKBASE_URI + TestTaxonomy_2004_06_15.PRESENTATION_ROLE );

            Assert.AreEqual( "blue", labelRef );
        }
Esempio n. 35
0
        public void PT_LoadPresentationSchema()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE);

            int errors = 0;
            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.IsNotNull( p );
            Assert.AreEqual( 4, errors );
        }
Esempio n. 36
0
        public void ifrs_BindElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            s.Load( IFRS_FILE );

            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.AreEqual( 144, errors, "load presentation failed" );

            s.presentationInfo = p.PresentationLinks;

            s.LoadElements( out errors );

            Assert.AreEqual( 5, errors, "load elements failed" ); //MIN missing sometimes, maxOccurs do not exist

            s.BindElements( new BindElementDelegate( s.BindElementToLocator ), out errors );

            Assert.AreEqual( 0, errors, "bind elements failed" );
        }
Esempio n. 37
0
        public void ifrs_GetLabelRoles()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( IFRS_FILE );

            int errors = 0;
            ArrayList roles = s.GetLabelRoles( false, out errors );

            Assert.AreEqual( 0, errors );
            Assert.AreEqual( 5, roles.Count );
            Assert.AreEqual( "documentation", roles[0] );
            Assert.AreEqual( "label", roles[1] );
            Assert.AreEqual( "periodEndLabel", roles[2] );
            Assert.AreEqual( "periodStartLabel", roles[3] );
            Assert.AreEqual( "restated", roles[4] );
        }
Esempio n. 38
0
        public void ifrs_LoadImportsAndBind()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if ( s.Load( IFRS_FILE, out errors ) == false )
            {
                Assert.Fail( (string)s.ErrorList[0] );
            }

            errors = 0;
            s.LoadPresentation( out errors );
            Assert.AreEqual( 144, errors, "wrong number of load presentation errors" );

            errors = 0;
            s.LoadElements( out errors );
            Assert.AreEqual( 5, errors, "wrong number of load element errors" );

            errors = 0;
            s.LoadImports( out errors );
            Assert.AreEqual( 0, errors, "wrong number of load import errors" );	// 5 ci elements are duplicated in the usfr-pt schema

            errors = 0;
            s.BindElements( new BindElementDelegate( s.BindElementToLocator ), out errors );
            Assert.AreEqual( 0, errors, "wrong number of bind errors" );

            // accounting policies is defined in the usfr-pt schema
            Assert.IsTrue( s.allElements.ContainsKey( "OtherLiabilitiesPolicy" ) );

            //Trace.Listeners.Clear();
        }
Esempio n. 39
0
        public void PT_ReadElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE);

            int errors = 0;
            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.AreEqual( 4, errors, "load presentation failed" );

            s.presentationInfo = p.PresentationLinks;

            s.LoadElements( out errors );
            Assert.AreEqual( 0, errors, "load elements failed" );
        }
Esempio n. 40
0
        public void PT_TargetNamespace()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE);

            s.GetTargetNamespace();

            Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/common/pt/usfr-pt-2004-06-15", s.targetNamespace );
        }
Esempio n. 41
0
        public void PT_BindElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            DateTime start = DateTime.Now;
            s.Load( PT_GAAP_FILE);

            int errors = 0;

            DateTime startPres = DateTime.Now;
            Presentation p = s.LoadPresentationSchema( out errors );
            DateTime endPres = DateTime.Now;
            Assert.AreEqual( 4, errors, "load presentation failed" );

            s.presentationInfo = p.PresentationLinks;

            DateTime startElems = DateTime.Now;
            s.LoadElements( out errors );
            DateTime endElems = DateTime.Now;

            Assert.AreEqual( 0, errors, "load elements failed" );

            DateTime startBind = DateTime.Now;
            s.BindElements( new BindElementDelegate( s.BindElementToLocator ), out errors );
            DateTime endBind = DateTime.Now;

            Console.WriteLine( "Total Time:			{0}", endBind-start );
            Console.WriteLine( "Read Presentation	{0}", endPres-startPres );
            Console.WriteLine( "Read Elements		{0}", endElems-startElems );
            Console.WriteLine( "Bind Elements		{0}", endBind-startBind );

            Assert.AreEqual( 936, errors, "bind elements failed" );
        }
Esempio n. 42
0
        public void PT_BindLabelsToElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            s.Load( PT_GAAP_FILE);

            errors = 0;

            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.AreEqual( 4, errors, "load presentation failed" );

            s.presentationInfo = p.PresentationLinks;

            s.LoadElements( out errors );

            Assert.AreEqual( 0, errors, "load elements failed" );

            s.BindElements( new BindElementDelegate( s.BindElementToLocator ), out errors );

            Assert.AreEqual( 936, errors, "bind elements failed" );

            errors = 0;
            s.LoadLabels( out errors );
            Assert.AreEqual( 0, errors, "load labels failed" );

            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            errors = 0;
            s.BindElements( new BindElementDelegate( s.BindLabelToElement ), out errors );
            Assert.AreEqual( 5, errors, "bind labels failure" );	// linkPart_Name, Subparagraph, Number, Paragraph, Chapter, no corresponding label info
            //Trace.Listeners.Clear();
        }
Esempio n. 43
0
        public void PT_GetLinkbaseRef_Presentation()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE);

            string presRef = s.GetLinkbaseReference( TestTaxonomy_2004_06_15.TARGET_LINKBASE_URI + TestTaxonomy_2004_06_15.PRESENTATION_ROLE );

            #if AUTOMATED
            Assert.AreEqual( @"q:\MAX\axe\XBRLParser\TestSchemas\XBRL 2.1 Updated\2004-06-15\usfr-pt-2004-06-15-presentation.xml", presRef );
            #else
            Assert.AreEqual( @"c:\Aucent\MAX\axe\XBRLParser\TestSchemas\XBRL 2.1 Updated\2004-06-15\usfr-pt-2004-06-15-presentation.xml", presRef );
            #endif
        }
Esempio n. 44
0
        public void SAG_TargetNamespace()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( SAG_FILE);

            s.GetTargetNamespace();

            Assert.IsNull( s.targetNamespace );
        }
Esempio n. 45
0
        public void PT_GetSupportedLanguages()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE);

            int errors = 0;
            ArrayList langs = s.GetSupportedLanguages( false, out errors );

            Assert.AreEqual( 0, errors );
            Assert.AreEqual( 1, langs.Count );
            Assert.AreEqual( "en", langs[0] );
        }
Esempio n. 46
0
        public void GAAP_Test_GetNodesByPresentation()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.CurrentLabelRole = "label";
            s.CurrentLanguage = "en";

            s.Load( US_GAAP_FILE);

            int errors = 0;

            s.Parse( out errors );

            ArrayList nodeList = s.GetNodesByPresentation();

            Assert.IsNotNull( nodeList );
            Assert.AreEqual( 5, nodeList.Count );

            Console.WriteLine( "Nodes By Presentation: " );

            foreach (Node n in nodeList )
            {
                Console.WriteLine( TestNode.ToXml( 0, n ) );
            }
        }
Esempio n. 47
0
        public void PT_LoadLabels()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE );

            int errors = 0;
            s.LoadLabels( out errors );

            Assert.AreEqual( 0, errors );
            Assert.AreEqual( 1478, s.labelTable.Count );
        }
Esempio n. 48
0
        public void ifrs_Parse()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            DateTime start = DateTime.Now;
            if ( s.Load( IFRS_FILE, out errors ) != true )
            {
                Assert.Fail( (string)s.ErrorList[0]);
            }

            errors = 0;
            s.Parse( out errors );
            DateTime end = DateTime.Now;
            Console.WriteLine( "Parse Time: {0}", end-start );

            TimeSpan level = new TimeSpan( 0, 0, 0, 10, 0 );	// 10 seconds to parse
            Assert.IsTrue( level > (end-start), "Parse takes too long" );

            PresentationLink pl = s.presentationInfo["Accounting Policies"] as PresentationLink;
            Assert.IsNotNull( pl );
        }
Esempio n. 49
0
        public void ifrs_LoadSchema()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            Assert.AreEqual( true, s.Load( IFRS_FILE, out errors ), "Could not load US GAAP File" );
        }
Esempio n. 50
0
        public void PT_Parse()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE );

            int errors = 0;
            s.Parse( out errors );

            Assert.AreEqual( 1898, errors );
        }
Esempio n. 51
0
        public void ifrs_LoadPresentationSchema()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if ( s.Load( IFRS_FILE, out errors ) != true )
            {
                Assert.Fail( (string)s.ErrorList[0] );
            }

            errors = 0;
            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.IsNotNull( p );
            Assert.AreEqual( 144, errors );
        }
Esempio n. 52
0
        public void ifrs_Test_VerifyTuples()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.CurrentLabelRole = "label";
            s.CurrentLanguage = "en";

            s.Load( IFRS_FILE);

            int errors = 0;

            s.Parse( out errors );

            ArrayList nodeList = s.GetNodesByElement();

            Assert.IsNotNull( nodeList );
            Assert.AreEqual( 2591, nodeList.Count );

            Console.WriteLine( "Found Tuple Nodes: " );

            foreach (Node n in nodeList )
            {
                RecurseVerifyTuples( n );
            }
        }
Esempio n. 53
0
        public void ifrs_TestTuples()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            s.Load( IFRS_FILE );

            s.Parse( out errors );

            if (s.boundElements != null)

            {
                IDictionaryEnumerator enumer = s.boundElements.GetEnumerator();

                Console.WriteLine( "Found Tuple Elements: " );

                while ( enumer.MoveNext() )
                {
                    RecurseElementsForTuples( enumer.Value as Element );
                }
            }
        }
Esempio n. 54
0
        public void ifrs_TargetNamespace()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( IFRS_FILE);

            s.GetTargetNamespace();

            Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/2004-06-15", s.targetNamespace );
        }
Esempio n. 55
0
        public void ifrs_GetLinkbaseRef_Presentation()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            Assert.AreEqual( true, s.Load( IFRS_FILE, out errors ), "Could not load US IFRS File" );

            string presRef = s.GetLinkbaseReference( TestTaxonomy_2004_06_15.TARGET_LINKBASE_URI + TestTaxonomy_2004_06_15.PRESENTATION_ROLE );

            #if AUTOMATED
            Assert.AreEqual( @"q:\MAX\axe\XBRLParser\TestSchemas\ifrs\ifrs-gp-2004-06-15-presentation.xml", presRef );
            #else
            Assert.AreEqual( @"C:\AUCENT\MAX\AXE\XBRLParser\TestSchemas\ifrs\ifrs-gp-2004-06-15-presentation.xml", presRef );
            #endif
        }
Esempio n. 56
0
        public void SAG_LoadSchema()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( SAG_FILE);
        }
Esempio n. 57
0
        public void ifrs_GetDependantTaxonomies()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            if ( !s.Load( IFRS_FILE, out errors ) )
            {
                Assert.Fail( (string)s.ErrorList[0]);
            }

            errors = 0;
            ArrayList imps = s.GetDependantTaxonomies( false, out errors );
            Assert.AreEqual( 0, errors, "error list not 0" );

            Assert.AreEqual( 0, imps.Count, "wrong number of imports returned" );
        }
Esempio n. 58
0
        public void ifrs_ReadElements()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            int errors = 0;

            s.Load( IFRS_FILE );

            int numElements = s.LoadElements( out errors );
            Assert.AreEqual( 5, errors );
            Assert.AreEqual( 2591, s.allElements.Count );
        }
Esempio n. 59
0
        public void PT_OutputTaxonomy()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE);

            int errors = 0;

            s.Parse( out errors );

            #if !AUTOMATED
            using ( StreamWriter sw = new StreamWriter( PT_OUT_FILE ) )
            {
                sw.Write( s.ToXmlString() );
            }
            #endif
        }
Esempio n. 60
0
        public void PT_LoadSchema()
        {
            TestTaxonomy_2004_06_15 s = new TestTaxonomy_2004_06_15();

            s.Load( PT_GAAP_FILE);
        }