Beispiel #1
0
        [Test] public void GAAP_LoadImports()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            int errors = 0;

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

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

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

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

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

            //Trace.Listeners.Clear();
        }
Beispiel #2
0
        [Test] public void GAAP_ReadElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            int errors = 0;

            s.Load(US_GAAP_FILE);

            int numElements = s.LoadElements(out errors);

            Assert.AreEqual(0, errors);
            Assert.AreEqual(5, s.allElements.Count);
        }
Beispiel #3
0
        [Test] public void GAAP_LoadImportsAndBind()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            int errors = 0;

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

            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.LoadPresentation(out errors);
            Assert.AreEqual(0, errors, "wrong number of load presentation errors");
            Assert.AreEqual(0, s.numWarnings, "wrong number of load presentation warnings");

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

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

            if (s.numWarnings > 0)
            {
                s.ErrorList.Sort();
                foreach (ParserMessage pm in s.ErrorList)
                {
                    if (pm.Level == TraceLevel.Warning)
                    {
                        Console.WriteLine("Warning: " + pm.Message);
                    }
                }
            }

            Assert.AreEqual(0, s.numWarnings, "wrong number of bind warnings");

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

            //Trace.Listeners.Clear();
        }
Beispiel #4
0
        [Test] public void PT_ReadElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            s.Load(PT_GAAP_FILE);

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

            Assert.AreEqual(0, errors, "load presentation failed");
            Assert.AreEqual(0, s.numWarnings, "wrong number of warnings");

            s.presentationInfo = p.PresentationLinks;

            s.LoadElements(out errors);
            Assert.AreEqual(0, errors, "load elements failed");
        }
Beispiel #5
0
        [Test] public void PT_BindElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            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(0, errors, "load presentation failed");
            Assert.AreEqual(0, s.numWarnings, "num warnings wrong");

            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(0, errors, "bind elements failed");
            Assert.AreEqual(0, s.numWarnings, "num warnings wrong");
        }
        public void GAAP_BindElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            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( 0, errors, "bind elements failed" );
            Assert.AreEqual( 0, s.numWarnings, "wrong number of warnings" );
        }
Beispiel #7
0
        [Test] public void PT_BindLabelsToElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            int errors = 0;

            s.Load(PT_GAAP_FILE);

            errors = 0;

            Presentation p = s.LoadPresentationSchema(out errors);

            Assert.AreEqual(0, 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(0, errors, "bind elements failed");
            Assert.AreEqual(0, s.numWarnings, "bind elements failed - wrong number of warnings");

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

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

            errors        = 0;
            s.numWarnings = 0;
            s.BindElements(new BindElementDelegate(s.BindLabelToElement), out errors);
            Assert.AreEqual(0, errors, "bind labels failure");                  // linkPart_Name, Subparagraph, Number, Paragraph, Chapter, no corresponding label info
            Assert.AreEqual(0, s.numWarnings, "wrong number of bind labels warnings");
            //Trace.Listeners.Clear();
        }
Beispiel #8
0
        [Test] public void GAAP_BindElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            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(0, errors, "bind elements failed");
            Assert.AreEqual(0, s.numWarnings, "wrong number of warnings");
        }
        public void PT_ReadElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            s.Load( PT_GAAP_FILE);

            int errors = 0;
            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.AreEqual( 0, errors, "load presentation failed" );
            Assert.AreEqual( 0, s.numWarnings, "wrong number of warnings" );

            s.presentationInfo = p.PresentationLinks;

            s.LoadElements( out errors );
            Assert.AreEqual( 0, errors, "load elements failed" );
        }
        public void PT_BindLabelsToElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            int errors = 0;

            s.Load( PT_GAAP_FILE);

            errors = 0;

            Presentation p = s.LoadPresentationSchema( out errors );
            Assert.AreEqual( 0, 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( 0, errors, "bind elements failed" );
            Assert.AreEqual( 0, s.numWarnings, "bind elements failed - wrong number of warnings" );

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

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

            errors = 0;
            s.numWarnings = 0;
            s.BindElements( new BindElementDelegate( s.BindLabelToElement ), out errors );
            Assert.AreEqual( 0, errors, "bind labels failure" );	// linkPart_Name, Subparagraph, Number, Paragraph, Chapter, no corresponding label info
            Assert.AreEqual( 0, s.numWarnings, "wrong number of bind labels warnings" );
            //Trace.Listeners.Clear();
        }
        public void PT_BindElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            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( 0, errors, "load presentation failed" );
            Assert.AreEqual( 0, s.numWarnings, "num warnings wrong" );

            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( 0, errors, "bind elements failed" );
            Assert.AreEqual( 0, s.numWarnings, "num warnings wrong" );
        }
        public void GAAP_ReadElements()
        {
            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            int errors = 0;

            s.Load( US_GAAP_FILE );

            int numElements = s.LoadElements( out errors );
            Assert.AreEqual( 0, errors );
            Assert.AreEqual( 5, s.allElements.Count );
        }
        public void GAAP_LoadImportsAndBind()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            int errors = 0;

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

            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.LoadPresentation( out errors );
            Assert.AreEqual( 0, errors, "wrong number of load presentation errors" );
            Assert.AreEqual( 0, s.numWarnings, "wrong number of load presentation warnings" );

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

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

            if ( s.numWarnings > 0 )
            {
                s.ErrorList.Sort();
                foreach ( ParserMessage pm in s.ErrorList )
                {
                    if ( pm.Level == TraceLevel.Warning )
                    {
                        Console.WriteLine( "Warning: " + pm.Message );
                    }
                }
            }

            Assert.AreEqual( 0, s.numWarnings, "wrong number of bind warnings" );

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

            //Trace.Listeners.Clear();
        }
        public void GAAP_LoadImports()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );

            TestTaxonomy_2004_07_06 s = new TestTaxonomy_2004_07_06();

            int errors = 0;

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

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

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

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

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

            //Trace.Listeners.Clear();
        }