public void TestUsGaap2008_DimensionValidation2() { //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) ); string fileName = @"C:\Users\srikanth.srinivasan\AppData\Roaming\Rivet\CrossTag\Taxonomies\cov\cov.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"); s.CurrentLanguage = s.SupportedLanguages[0] as string; s.CurrentLabelRole = "preferredLabel"; ArrayList nodes = s.GetNodesByPresentation(true); s.TryBuildDimensionValidationInformation(); ArrayList segments = new ArrayList(); ArrayList scenarios = new ArrayList(); string elementId = "us-gaap_GainLossRelatedToLitigationSettlement"; Segment seg = new Segment(); seg.DimensionInfo = new ContextDimensionInfo(); seg.DimensionInfo.dimensionId = "us-gaap_ProductOrServiceAxis"; seg.DimensionInfo.Id = "cov_LitigationLossMember"; segments.Add(seg); string error; bool ret = s.IsDimensionInformationValid(elementId, segments, scenarios, out error); Assert.IsFalse(ret, "should return failure"); Console.WriteLine(error); s.linkbaseFileInfos.Sort(); foreach (LinkbaseFileInfo lbfi in s.linkbaseFileInfos) { Console.WriteLine(lbfi.ToString()); } }
public void TestUsGaap2008_DimensionValidation() { //Trace.Listeners.Add( new TextWriterTraceListener(Console.Out) ); string fileName = TestCommon.FolderRoot + @"XBRLUSGAAPTaxonomies-2008-02-13\ind\ci\us-gaap-ci-stm-2008-01-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"); s.CurrentLanguage = s.SupportedLanguages[0] as string; s.CurrentLabelRole = "preferredLabel"; ArrayList nodes = s.GetNodesByPresentation(true); s.TryBuildDimensionValidationInformation(); ArrayList segments = new ArrayList(); ArrayList scenarios = new ArrayList(); string elementId = "us-gaap_NetIncomeLossAvailableToCommonStockholdersBasic"; Segment seg = new Segment(); seg.DimensionInfo = new ContextDimensionInfo(); seg.DimensionInfo.dimensionId = "us-gaap_StatementScenarioAxis"; seg.DimensionInfo.Id = "us-gaap_ScenarioActualMember"; segments.Add(seg); string error; bool ret = s.IsDimensionInformationValid(elementId, segments, scenarios, out error); Assert.IsFalse(ret, "should return failure"); Console.WriteLine(error); s.linkbaseFileInfos.Sort(); foreach (LinkbaseFileInfo lbfi in s.linkbaseFileInfos) { Console.WriteLine(lbfi.ToString()); } }