public void Test_Load_UK_COMPANIES_HOUSE() { TestTaxonomy_Definition s = new TestTaxonomy_Definition(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(COMPANIES_HOUSE_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases // parse presentation first s.CurrentLabelRole = "preferredLabel"; s.CurrentLanguage = "en"; s.Parse(out errors); Assert.AreEqual(0, errors, "should not have any errors"); ArrayList nodes = s.GetNodesByPresentation(); foreach (Node n in nodes) { StringBuilder sb = DisplayNode(n, 0); Console.WriteLine(sb.ToString()); } //MAKE SURE THAT THE DIMENSION INFORMATION IS LOADED Assert.IsNotNull(s.NetDefinisionInfo, "Definition info should not be null"); Dictionary <string, List <string> > requiresElementRelationships = s.NetDefinisionInfo.GetRequiredElementRelationshipInfo(); Assert.IsTrue(requiresElementRelationships.Count == 5, "should have some requires element relationships built"); List <string> val = requiresElementRelationships["uk-gaap-ae_CompaniesHouseRegisteredNumber"]; Assert.AreEqual(8, val.Count); Assert.IsTrue(val.Contains("uk-gaap-pt_NetAssetsLiabilitiesIncludingPensionAssetLiability"), "value not found in requires element relationhip"); foreach (KeyValuePair <string, List <string> > kvp in requiresElementRelationships) { foreach (string child in kvp.Value) { Console.WriteLine("Element {0} depends on Element {1}", kvp.Key, child); } } }
public void Test_Load_COREP_D_TY() { TestTaxonomy_Definition s = new TestTaxonomy_Definition(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(COREP_D_TY, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases // parse presentation first s.CurrentLabelRole = "preferredLabel"; s.CurrentLanguage = "en"; s.Parse(out errors); Assert.AreEqual(0, errors, "should not ahve any errors"); Element el = s.AllElements["d-ty_NationalMarketDimension"] as Element; Assert.AreEqual("d-ty_NationalMarket", el.TypedDimensionId, "Typed dimension Id not set"); el = s.AllElements["d-ty_SecuritizationInternalCode"] as Element; Assert.IsNull(el, "d-ty_SecuritizationInternalCode shouod not be an element as it oes not have a substitution group"); IXBRLCustomType customType = s.customDataTypesHash["d-ty_SecuritizationInternalCode"] as IXBRLCustomType; Assert.IsNotNull(customType, "custom type did not get created"); Assert.IsTrue(customType is XBRLSimpleType, "custom type is not correct"); customType = s.customDataTypesHash["d-ty_BasicInformation"] as IXBRLCustomType; Assert.IsNotNull(customType, "custom type did not get created"); Assert.IsTrue(customType is XBRLComplexType, "custom type is not correct"); customType = s.customDataTypesHash["d-ty_InternalReferenceNumber"] as IXBRLCustomType; Assert.IsNotNull(customType, "custom type did not get created"); Assert.IsTrue(customType is XBRLSimpleType, "custom type is not correct"); customType = s.customDataTypesHash["d-ty_Day"] as IXBRLCustomType; Assert.IsNotNull(customType, "custom type did not get created"); Assert.IsTrue(customType is XBRLSimpleType, "custom type is not correct"); }
public void Test_Load_ICI() { TestTaxonomy_Definition s = new TestTaxonomy_Definition(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(TestTaxonomy_Definition.ICI_FILE, out errors) != true) { Assert.Fail((string)s.ErrorList[0]); } errors = 0; // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases // parse presentation first s.CurrentLabelRole = "preferredLabel"; s.CurrentLanguage = "en"; s.Parse(out errors); Assert.AreEqual(0, errors, "should not have any errors"); ArrayList nodes = s.GetNodesByPresentation(); foreach (Node n in nodes) { StringBuilder sb = DisplayNode(n, 0); Console.WriteLine(sb.ToString()); } //MAKE SURE THAT THE DIMENSION INFORMATION IS LOADED Assert.IsNotNull(s.NetDefinisionInfo, "Definition info should not be null"); //make sure that the subs groups are defined properly at the element level Element ele = s.AllElements["ici-rr_RegistrantHypercube"] as Element; Assert.AreEqual("xbrldt:hypercubeItem", ele.SubstitutionGroup, "Substitution group not correct"); Assert.AreEqual("xbrli:stringItemType", ele.ElementType, "Type not set correctly"); ele = s.AllElements["ici-rr_RegistrantDimension"] as Element; Assert.AreEqual("xbrldt:dimensionItem", ele.SubstitutionGroup, "Substitution group not correct"); Assert.AreEqual("xbrli:stringItemType", ele.ElementType, "Type not set correctly"); ele = s.AllElements["ici-rr_AnticipatedEffectiveDate"] as Element; Assert.AreEqual("xbrli:item", ele.SubstitutionGroup, "Substitution group not correct"); Assert.AreEqual("xbrli:dateItemType", ele.ElementType, "Type not set correctly"); }
public void Test_Load_COREP_D_TY() { TestTaxonomy_Definition s = new TestTaxonomy_Definition(); int errors = 0; DateTime start = DateTime.Now; if ( s.Load( COREP_D_TY, out errors ) != true ) { Assert.Fail( (string)s.ErrorList[0]); } errors = 0; // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases // parse presentation first s.CurrentLabelRole ="preferredLabel"; s.CurrentLanguage = "en"; s.Parse( out errors ); Assert.AreEqual( 0, errors, "should not ahve any errors"); Element el = s.AllElements["d-ty_NationalMarketDimension"] as Element; Assert.AreEqual( "d-ty_NationalMarket", el.TypedDimensionId , "Typed dimension Id not set"); el = s.AllElements["d-ty_SecuritizationInternalCode"] as Element; Assert.IsNull( el, "d-ty_SecuritizationInternalCode shouod not be an element as it oes not have a substitution group"); IXBRLCustomType customType = s.customDataTypesHash["d-ty_SecuritizationInternalCode"] as IXBRLCustomType; Assert.IsNotNull( customType, "custom type did not get created"); Assert.IsTrue( customType is XBRLSimpleType , "custom type is not correct"); customType = s.customDataTypesHash["d-ty_BasicInformation"] as IXBRLCustomType; Assert.IsNotNull( customType, "custom type did not get created"); Assert.IsTrue( customType is XBRLComplexType , "custom type is not correct"); customType = s.customDataTypesHash["d-ty_InternalReferenceNumber"] as IXBRLCustomType; Assert.IsNotNull( customType, "custom type did not get created"); Assert.IsTrue( customType is XBRLSimpleType , "custom type is not correct"); customType = s.customDataTypesHash["d-ty_Day"] as IXBRLCustomType; Assert.IsNotNull( customType, "custom type did not get created"); Assert.IsTrue( customType is XBRLSimpleType , "custom type is not correct"); }
public void Test_Load_UK_COMPANIES_HOUSE() { TestTaxonomy_Definition s = new TestTaxonomy_Definition(); int errors = 0; DateTime start = DateTime.Now; if ( s.Load( COMPANIES_HOUSE_FILE, out errors ) != true ) { Assert.Fail( (string)s.ErrorList[0]); } errors = 0; // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases // parse presentation first s.CurrentLabelRole ="preferredLabel"; s.CurrentLanguage = "en"; s.Parse( out errors ); Assert.AreEqual( 0, errors, "should not have any errors"); ArrayList nodes = s.GetNodesByPresentation(); foreach ( Node n in nodes ) { StringBuilder sb = DisplayNode( n, 0 ); Console.WriteLine( sb.ToString() ); } //MAKE SURE THAT THE DIMENSION INFORMATION IS LOADED Assert.IsNotNull( s.NetDefinisionInfo, "Definition info should not be null"); Dictionary<string, List<string>> requiresElementRelationships = s.NetDefinisionInfo.GetRequiredElementRelationshipInfo(); Assert.IsTrue( requiresElementRelationships.Count == 5 , "should have some requires element relationships built"); List<string> val = requiresElementRelationships["uk-gaap-ae_CompaniesHouseRegisteredNumber"] ; Assert.AreEqual( 8, val.Count ); Assert.IsTrue( val.Contains( "uk-gaap-pt_NetAssetsLiabilitiesIncludingPensionAssetLiability"), "value not found in requires element relationhip"); foreach( KeyValuePair<string, List<string>> kvp in requiresElementRelationships) { foreach (string child in kvp.Value ) { Console.WriteLine("Element {0} depends on Element {1}", kvp.Key, child); } } }
public void Test_Load_ICI() { TestTaxonomy_Definition s = new TestTaxonomy_Definition(); int errors = 0; DateTime start = DateTime.Now; if (s.Load(TestTaxonomy_Definition.ICI_FILE, out errors) != true) { Assert.Fail( (string)s.ErrorList[0]); } errors = 0; // this loads up all dependant taxonomies, and loads the corresponding presentation, calculation, label, and reference linkbases // parse presentation first s.CurrentLabelRole ="preferredLabel"; s.CurrentLanguage = "en"; s.Parse( out errors ); Assert.AreEqual( 0, errors, "should not have any errors"); ArrayList nodes = s.GetNodesByPresentation(); foreach ( Node n in nodes ) { StringBuilder sb = DisplayNode( n, 0 ); Console.WriteLine( sb.ToString() ); } //MAKE SURE THAT THE DIMENSION INFORMATION IS LOADED Assert.IsNotNull( s.NetDefinisionInfo, "Definition info should not be null"); //make sure that the subs groups are defined properly at the element level Element ele = s.AllElements["ici-rr_RegistrantHypercube"] as Element; Assert.AreEqual( "xbrldt:hypercubeItem", ele.SubstitutionGroup, "Substitution group not correct"); Assert.AreEqual( "xbrli:stringItemType", ele.ElementType, "Type not set correctly"); ele = s.AllElements["ici-rr_RegistrantDimension"] as Element; Assert.AreEqual( "xbrldt:dimensionItem", ele.SubstitutionGroup, "Substitution group not correct"); Assert.AreEqual( "xbrli:stringItemType", ele.ElementType, "Type not set correctly"); ele = s.AllElements["ici-rr_AnticipatedEffectiveDate"] as Element; Assert.AreEqual( "xbrli:item", ele.SubstitutionGroup, "Substitution group not correct"); Assert.AreEqual( "xbrli:dateItemType", ele.ElementType, "Type not set correctly"); }