/// <exclude/> private void TestUsGaap2009Web(string fileName) { //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) ); TestUsGaap2008 s = new TestUsGaap2008(); s.KeepInnerTaxonomies = true; int errors = 0; DateTime start = DateTime.Now; if (s.Load(fileName, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } s.Parse(out errors); DateTime end = DateTime.Now; Console.WriteLine("time taken = {0}", end - start); Assert.AreEqual(0, errors, "should not have any errors"); s.CurrentLanguage = s.SupportedLanguages[0] as string; s.currentLabelRole = PresentationLocator.preferredLabelRole; start = DateTime.Now; s.GetNodesByPresentation(true); s.GetNodesByPresentation(); s.GetNodesByCalculation(); List<DimensionNode> tmp; s.TryGetAllDimensionNodesForDisplay(s.currentLanguage, s.currentLabelRole, true, out tmp); end = DateTime.Now; Console.WriteLine("GET NODES BY PRESENTATION TIME = {0}", end - start); //all the href references should be web based.... foreach (RoleRef rr in s.roleRefs.Values) { Assert.IsTrue(rr.href.StartsWith("http"), "Failed ot build the correct href"); } foreach (RoleType rt in s.roleTypes.Values) { Assert.IsTrue(rt.GetHref().StartsWith("http"), "Failed to build the correct href"); } foreach( TaxonomyItem ti in s.TaxonomyItems ) { Assert.IsTrue(ti.Location.StartsWith("http"), "Failed ot build the correct href"); } int countCustomTypeTax = 0; foreach (TaxonomyItem ti in s.infos) { if (ti.HasCustomTypes) { countCustomTypeTax++; Console.WriteLine("FOUND CUSTOM TYPES INFO"); Console.WriteLine(ti.WebLocation + ti.Location); } } Assert.AreEqual(1, countCustomTypeTax, "Should have only one custom type taxonomy"); List<string> xsdNames = new List<string>(); foreach (LinkbaseFileInfo lfi in s.linkbaseFileInfos) { foreach (string role in lfi.RoleRefURIs) { Console.WriteLine(" ROLE = {0} XSD = {1}", role , lfi.XSDFileName); } } Dictionary<string, string> linkbaseXSDMap = new Dictionary<string, string>(); foreach (Taxonomy depT in s.DependantTaxonomies) { string xsdName = Path.GetFileName(depT.infos[0].Location); if (depT.presentationFile != null) { foreach (string file in depT.presentationFile) { string val; if (linkbaseXSDMap.TryGetValue(Path.GetFileName(file), out val)) { if (!val.Equals(xsdName)) { Console.WriteLine("FOUND TWO XSD INCLUDING THE SAME PRESENTATION LINKBASE "); Console.WriteLine("{0} {1}", xsdName, val); } } else { linkbaseXSDMap.Add(Path.GetFileName(file), xsdName); } Console.WriteLine("{0} - {1}", Path.GetFileName(file), xsdName); } } if (depT.DefinitionFile != null) { foreach (string file in depT.DefinitionFile) { string val; if (linkbaseXSDMap.TryGetValue(Path.GetFileName(file), out val)) { if (!val.Equals(xsdName)) { Console.WriteLine("FOUND TWO XSD INCLUDING THE SAME DEFINITION LINKBASE "); Console.WriteLine("{0} {1}", xsdName, val); } } else { linkbaseXSDMap.Add(Path.GetFileName(file), xsdName); } Console.WriteLine("{0} - {1}", Path.GetFileName(file), xsdName); } } if (depT.calculationFile != null) { foreach (string file in depT.calculationFile) { string val; if (linkbaseXSDMap.TryGetValue(Path.GetFileName(file), out val)) { if (!val.Equals(xsdName)) { Console.WriteLine("FOUND TWO XSD INCLUDING THE SAME CALCULATION LINKBASE "); Console.WriteLine("{0} {1}", xsdName, val); } } else { linkbaseXSDMap.Add(Path.GetFileName(file), xsdName); } Console.WriteLine("{0} - {1}", Path.GetFileName(file), xsdName); } } if (depT.LabelFile != null) { foreach (string file in depT.LabelFile) { string val; if (linkbaseXSDMap.TryGetValue(Path.GetFileName(file), out val)) { if (!val.Equals(xsdName)) { Console.WriteLine("FOUND TWO XSD INCLUDING THE SAME LABEL LINKBASE "); Console.WriteLine("{0} {1}", xsdName, val); } } else { linkbaseXSDMap.Add(Path.GetFileName(file), xsdName); } Console.WriteLine("{0} - {1}", Path.GetFileName(file), xsdName); } } if (depT.ReferenceFile != null) { foreach (string file in depT.ReferenceFile) { string val; if (linkbaseXSDMap.TryGetValue(Path.GetFileName(file), out val)) { if (!val.Equals(xsdName)) { Console.WriteLine("FOUND TWO XSD INCLUDING THE SAME REFERENCE LINKBASE "); Console.WriteLine("{0} {1}", xsdName, val); } } else { linkbaseXSDMap.Add(Path.GetFileName(file), xsdName); } Console.WriteLine("{0} - {1}", Path.GetFileName(file), xsdName); } } } }