예제 #1
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();
        }
예제 #2
0
        [Test] 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();
        }
예제 #3
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" );
        }
예제 #4
0
        [Test] 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");
        }
예제 #5
0
        [Test] 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");
        }
예제 #6
0
        [Test] 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");
        }
예제 #7
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();
        }
예제 #8
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" );
        }
예제 #9
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();
        }
예제 #10
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" );
        }