示例#1
0
        public void EmptyFilename()
        {
            TestDocumentBase s = new TestDocumentBase();

            int errors = 0;

            s.Load("", out errors);
            Assert.AreEqual(1, errors);

            Console.WriteLine("Null Filename msg: {0}", s.ErrorList[0]);
        }
示例#2
0
        public void EmptyFilename()
        {
            TestDocumentBase s = new TestDocumentBase();

            int errors = 0;

            s.Load( "", out errors );
            Assert.AreEqual( 1, errors );

            Console.WriteLine( "Null Filename msg: {0}", s.ErrorList[0] );
        }
示例#3
0
        public void TestPresHrefIsURL_GetLinkbaseRef()
        {
            TestDocumentBase s = new TestDocumentBase();

            int errors = 0;

            Assert.AreEqual(true, s.Load(TESTPRESHREFISURL_FILE, out errors), "Could not load TestPresHrefIsURL File");
            Assert.AreEqual(0, errors);

            const string PRESENTATION_ROLE = "/presentationLinkbaseRef";

            string[] presRef = s.GetLinkbaseReference(DocumentBase.TARGET_LINKBASE_URI + PRESENTATION_ROLE);

            // presRef should be the URL without the schema path
            Assert.AreEqual(@"http://xbrl.iasb.org/int/fr/ifrs/gp/2005-05-15/ifrs-gp-pre-bs-classified-2005-05-15.xml", presRef[0]);
        }
示例#4
0
        public void GAAP_GetLinkbaseRef_Presentation()
        {
            TestDocumentBase s = new TestDocumentBase();

            //ErrorInfo ei = null;

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

            const string PRESENTATION_ROLE		= "/presentationLinkbaseRef";

            string[] presRef = s.GetLinkbaseReference( DocumentBase.TARGET_LINKBASE_URI + PRESENTATION_ROLE );

            Assert.AreEqual( TestCommon.FolderRoot + @"XBRL 2.1 Updated" +System.IO.Path.DirectorySeparatorChar +"2004-07-06" +System.IO.Path.DirectorySeparatorChar +"us-gaap-ci-2004-07-06-presentation.xml", presRef[0] );
        }
示例#5
0
        public void GAAP_GetLinkbaseRef_Presentation()
        {
            TestDocumentBase s = new TestDocumentBase();

            //ErrorInfo ei = null;

            int errors = 0;

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

            const string PRESENTATION_ROLE = "/presentationLinkbaseRef";

            string[] presRef = s.GetLinkbaseReference(DocumentBase.TARGET_LINKBASE_URI + PRESENTATION_ROLE);

            Assert.AreEqual(TestCommon.FolderRoot + @"XBRL 2.1 Updated" + System.IO.Path.DirectorySeparatorChar + "2004-07-06" + System.IO.Path.DirectorySeparatorChar + "us-gaap-ci-2004-07-06-presentation.xml", presRef[0]);
        }
示例#6
0
        public void SAG_LoadSchema()
        {
            TestDocumentBase s = new TestDocumentBase();
            //ErrorInfo ei = null;

            int errors = 0;

            Assert.AreEqual(true, s.Load(SAG_FILE, out errors), "Could not load SoftwareAG file");
            Assert.AreEqual(0, errors);

            Console.WriteLine("Verify SAG Namespace:");

            Assert.AreEqual("http://www.xbrl.org/2003/instance", s.theManager.DefaultNamespace);

            // verify namespaces
            foreach (string pre in s.theManager)
            {
                string x = s.theManager.LookupNamespace(pre);

                switch (pre)
                {
                case "link":
                    Assert.AreEqual("http://www.xbrl.org/2003/linkbase", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: link ");
                    break;

                case "xbrldt":
                    Assert.AreEqual("http://xbrl.org/2005/xbrldt", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xbrldt ");
                    break;

                case "xlink":
                    Assert.AreEqual("http://www.w3.org/1999/xlink", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xlink");
                    break;

                case "sag-es":
                    Assert.AreEqual("http://www.softwareag.com/es/xbrl/taxonomy/2004-01-30", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: sag-es");
                    break;

                case "ifrs-gp":
                    Assert.AreEqual("http://xbrl.iasb.org/int/fr/ifrs/gp/2004-01-15", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: ifrs-gp ");
                    break;

                case "iso4217":
                    Assert.AreEqual("http://www.xbrl.org/2003/iso4217", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: iso4217 ");
                    break;

                case "xsd":
                    Assert.AreEqual("http://www.w3.org/2001/XMLSchema", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xsd ");
                    break;

                case "xsi":
                    Assert.AreEqual("http://www.w3.org/2001/XMLSchema-instance", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xsi ");
                    break;

                case "xml":                             // ignore
                case "xmlns":                           // ignore
                case "xbrli":                           // ignore
                case "":                                // ignore
                    //Assert.AreEqual( "http://www.w3.org/2001/XMLSchema", s.theManager.LookupNamespace( pre ) );
                    break;

                default:
                    Console.WriteLine("Unknown namespace: prefix: " + pre + " namespace: " + x);
                    Assert.Fail("	Unknown prefix in namespace table: "+ pre + " namespace: " + x);
                    break;
                }
            }
        }
示例#7
0
        public void LoadSchema()
        {
            TestDocumentBase s = new TestDocumentBase();
            int errors         = 0;

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

            Console.WriteLine("Verify GAAP namespace:");

            Console.WriteLine("US_GAAP_FILE.ToLower(): " + US_GAAP_FILE.ToLower());
            Console.WriteLine("s.schemaFile.ToLower(): " + s.schemaFile.ToLower());

            Assert.AreEqual(US_GAAP_FILE.ToLower(), s.schemaFile.ToLower());


            Console.WriteLine("TestSchemaPath: " + (TestCommon.FolderRoot + @"XBRL 2.1 Updated" + System.IO.Path.DirectorySeparatorChar + "2004-07-06").ToLower());
            Console.WriteLine("s.schemaPath:   " + s.schemaPath.ToLower());
            Assert.AreEqual(TestCommon.FolderRoot + @"XBRL 2.1 Updated" + System.IO.Path.DirectorySeparatorChar + "2004-07-06", s.schemaPath);

            Assert.AreEqual("us-gaap-ci-2004-07-06.xsd", s.schemaFilename);

            Assert.AreEqual("http://www.w3.org/2001/XMLSchema", s.theManager.DefaultNamespace);

            // verify namespaces
            foreach (string pre in s.theManager)
            {
                string x = s.theManager.LookupNamespace(pre);

                switch (pre)
                {
                case "xhtml":
                    Assert.AreEqual("http://www.w3.org/1999/xhtml", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xhtml ");
                    break;

                case "link":
                    Assert.AreEqual("http://www.xbrl.org/2003/linkbase", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: link ");
                    break;

                case "xbrli":
                    Assert.AreEqual("http://www.xbrl.org/2003/instance", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xbrli ");
                    break;

                case "xlink":
                    Assert.AreEqual("http://www.w3.org/1999/xlink", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xlink ");
                    break;

                case "xbrldt":
                    Assert.AreEqual("http://xbrl.org/2005/xbrldt", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xbrldt ");
                    break;


                case "us-gaap-ci":
                    Assert.AreEqual("http://www.xbrl.org/taxonomy/us/fr/gaap/ci/us-gaap-ci-2004-07-06", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: us-gaap-ci ");
                    break;

                case "xsd":
                    Assert.AreEqual("http://www.w3.org/2001/XMLSchema", s.theManager.LookupNamespace(pre));
                    Console.WriteLine("	Found namespace: xsd ");
                    break;

                case "xml":                             // ignore
                case "xmlns":                           // ignore
                case "":                                // ignore
                    //Assert.AreEqual( "http://www.w3.org/2001/XMLSchema", s.theManager.LookupNamespace( pre ) );
                    break;

                default:
                    Console.WriteLine("Unknown namespace: prefix: " + pre + " namespace: " + x);
                    Assert.Fail("Unknown prefix in namespace table: " + pre + " namespace: " + x);
                    break;
                }
            }
        }
示例#8
0
        public void LoadSchema()
        {
            TestDocumentBase s = new TestDocumentBase();
            int errors = 0;
            Assert.AreEqual( true, s.Load( US_GAAP_FILE, out errors ), "Could not load US GAAP File" );
            Assert.AreEqual( 0, errors );

            Console.WriteLine( "Verify GAAP namespace:" );

            Console.WriteLine("US_GAAP_FILE.ToLower(): " + US_GAAP_FILE.ToLower());
            Console.WriteLine("s.schemaFile.ToLower(): " + s.schemaFile.ToLower());

            Assert.AreEqual( US_GAAP_FILE.ToLower(), s.schemaFile.ToLower() );

            Console.WriteLine("TestSchemaPath: " +(TestCommon.FolderRoot + @"XBRL 2.1 Updated" +System.IO.Path.DirectorySeparatorChar +"2004-07-06").ToLower());
            Console.WriteLine("s.schemaPath:   " + s.schemaPath.ToLower());
            Assert.AreEqual( TestCommon.FolderRoot + @"XBRL 2.1 Updated" +System.IO.Path.DirectorySeparatorChar +"2004-07-06", s.schemaPath );

            Assert.AreEqual( "us-gaap-ci-2004-07-06.xsd", s.schemaFilename );

            Assert.AreEqual( "http://www.w3.org/2001/XMLSchema", s.theManager.DefaultNamespace );

            // verify namespaces
            foreach ( string pre in s.theManager )
            {
                string x = s.theManager.LookupNamespace( pre );

                switch ( pre )
                {
                    case "xhtml":
                        Assert.AreEqual( "http://www.w3.org/1999/xhtml", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: xhtml " );
                        break;

                    case "link":
                        Assert.AreEqual( "http://www.xbrl.org/2003/linkbase", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: link " );
                        break;

                    case "xbrli":
                        Assert.AreEqual( "http://www.xbrl.org/2003/instance", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: xbrli " );
                        break;

                    case "xlink":
                        Assert.AreEqual( "http://www.w3.org/1999/xlink", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: xlink " );
                        break;
                    case "xbrldt":
                        Assert.AreEqual("http://xbrl.org/2005/xbrldt", s.theManager.LookupNamespace(pre));
                        Console.WriteLine("	Found namespace: xbrldt ");
                        break;

                    case "us-gaap-ci":
                        Assert.AreEqual( "http://www.xbrl.org/taxonomy/us/fr/gaap/ci/us-gaap-ci-2004-07-06", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: us-gaap-ci " );
                        break;

                    case "xsd":
                        Assert.AreEqual( "http://www.w3.org/2001/XMLSchema", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: xsd " );
                        break;

                    case "xml":		// ignore
                    case "xmlns":	// ignore
                    case "":		// ignore
                        //Assert.AreEqual( "http://www.w3.org/2001/XMLSchema", s.theManager.LookupNamespace( pre ) );
                        break;

                    default:
                        Console.WriteLine( "Unknown namespace: prefix: " + pre + " namespace: " + x );
                        Assert.Fail(	"Unknown prefix in namespace table: " + pre + " namespace: " + x );
                        break;
                }
            }
        }
示例#9
0
        public void TestPresHrefIsURL_GetLinkbaseRef()
        {
            TestDocumentBase s = new TestDocumentBase();

            int errors = 0;
            Assert.AreEqual( true, s.Load( TESTPRESHREFISURL_FILE, out errors ), "Could not load TestPresHrefIsURL File" );
            Assert.AreEqual( 0, errors );

            const string PRESENTATION_ROLE		= "/presentationLinkbaseRef";

            string[] presRef = s.GetLinkbaseReference( DocumentBase.TARGET_LINKBASE_URI + PRESENTATION_ROLE );

            // presRef should be the URL without the schema path
            Assert.AreEqual( @"http://xbrl.iasb.org/int/fr/ifrs/gp/2005-05-15/ifrs-gp-pre-bs-classified-2005-05-15.xml", presRef[0] );
        }
示例#10
0
        public void SAG_LoadSchema()
        {
            TestDocumentBase s = new TestDocumentBase();
            //ErrorInfo ei = null;

            int errors = 0;
            Assert.AreEqual( true, s.Load( SAG_FILE, out errors ), "Could not load SoftwareAG file" );
            Assert.AreEqual( 0, errors );

            Console.WriteLine( "Verify SAG Namespace:" );

            Assert.AreEqual( "http://www.xbrl.org/2003/instance", s.theManager.DefaultNamespace );

            // verify namespaces
            foreach ( string pre in s.theManager )
            {
                string x = s.theManager.LookupNamespace( pre );

                switch ( pre )
                {
                    case "link":
                        Assert.AreEqual( "http://www.xbrl.org/2003/linkbase", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: link " );
                        break;
                    case "xbrldt":
                        Assert.AreEqual("http://xbrl.org/2005/xbrldt", s.theManager.LookupNamespace(pre));
                        Console.WriteLine("	Found namespace: xbrldt ");
                        break;

                    case "xlink":
                        Assert.AreEqual( "http://www.w3.org/1999/xlink", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: xlink" );
                        break;

                    case "sag-es":
                        Assert.AreEqual( "http://www.softwareag.com/es/xbrl/taxonomy/2004-01-30", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: sag-es" );
                        break;

                    case "ifrs-gp":
                        Assert.AreEqual( "http://xbrl.iasb.org/int/fr/ifrs/gp/2004-01-15", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: ifrs-gp " );
                        break;

                    case "iso4217":
                        Assert.AreEqual( "http://www.xbrl.org/2003/iso4217", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: iso4217 " );
                        break;

                    case "xsd":
                        Assert.AreEqual( "http://www.w3.org/2001/XMLSchema", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: xsd " );
                        break;

                    case "xsi":
                        Assert.AreEqual( "http://www.w3.org/2001/XMLSchema-instance", s.theManager.LookupNamespace( pre ) );
                        Console.WriteLine( "	Found namespace: xsi " );
                        break;

                    case "xml":		// ignore
                    case "xmlns":	// ignore
                    case "xbrli":	// ignore
                    case "":		// ignore
                        //Assert.AreEqual( "http://www.w3.org/2001/XMLSchema", s.theManager.LookupNamespace( pre ) );
                        break;

                    default:
                        Console.WriteLine( "Unknown namespace: prefix: " + pre + " namespace: " + x );
                        Assert.Fail( "	Unknown prefix in namespace table: " + pre + " namespace: " + x );
                        break;
                }
            }
        }