Beispiel #1
0
        public void TestUsGaap2007_basi()
        {
            //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) );
            string fileName = TestCommon.FolderRoot + @"USFRTF-2007-10-30-prerelease" + System.IO.Path.DirectorySeparatorChar + "us-gaap-entryPoint-basi-2007-12-31.xsd";

            TestUsGaap2008 s = new TestUsGaap2008();

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

            s.Parse(out errors);

            Assert.AreEqual(0, errors, "should not have any errors");

            Assert.AreEqual(13320, s.allElements.Count, "wrong number of elements returned");

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

            ArrayList nodes = s.GetNodesByPresentation();

            DateTime end = DateTime.Now;

            Console.WriteLine("time taken = {0}", end - start);
            int count = 0;
            int dimensionNodeCount = 0;
            foreach (Node n in nodes)
            {
                StringBuilder sb = DisplayNode(n, 0, ref count, ref dimensionNodeCount);
                Console.WriteLine(sb.ToString());
            }
            Console.WriteLine("Count of elements in presentation = {0}", count);
            Console.WriteLine("time taken = {0}", end - start);

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

            Assert.AreEqual(0, errors);
            Assert.AreEqual(1, langs.Count , "should have one supported language defined");
        }