private void CheckForErrors(IDSFDataObject dataObject, int update, IDev2IndexFinder indexFinder, ErrorResultTO allErrors, ErrorResultTO errors, WarewolfListIterator innerIteratorCollection, List <string> completeResultList, WarewolfIterator itrInField, string chars) { if (!string.IsNullOrEmpty(InField) && !string.IsNullOrEmpty(Characters)) { var val = innerIteratorCollection.FetchNextValue(itrInField); if (val != null) { var returedData = indexFinder.FindIndex(val, Index, chars, Direction, MatchCase, StartIndex); completeResultList.AddRange(returedData.Select(value => value.ToString(CultureInfo.InvariantCulture)).ToList()); var rule = new IsSingleValueRule(() => Result); var single = rule.Check(); if (single != null) { allErrors.AddError(single.Message); } else { dataObject.Environment.Assign(Result, string.Join(",", completeResultList), update); allErrors.MergeErrors(errors); } } } }
public void FindIndex_RawData_Search_In_RawData_First_LeftToRight_Expected_Index_Of_Four_Returned() { var actual = _indexFinder.FindIndex("ABCFDEFGHIB", enIndexFinderOccurrence.FirstOccurrence, "F", enIndexFinderDirection.LeftToRight, false, 0); Assert.AreEqual(4, actual.ElementAt(0)); }