private void ReplaceItems(List <FoundItem> FIList, string newValue) { foreach (FoundItem foundItem in FIList) { if (mFindAndReplaceUtils.ReplaceItem(mSearchConfig, mFindWhat, foundItem, newValue)) { foundItem.Status = FoundItem.eStatus.Replaced; } else { foundItem.Status = FoundItem.eStatus.ReplaceFailed; } } }
public void ReplaceIntValueTest() { ResetActionList(); ObservableList <FoundItem> foundItemsList = new ObservableList <FoundItem>(); List <string> ValuesToFind = new List <string>() { "13132424" }; FindFieldsFromAllActionsOnBusinessFlowsList(foundItemsList, ValuesToFind, mSearchConfig1); FoundItem FI = foundItemsList[0]; FindAndReplaceUtils findAndReplaceUtils = new FindAndReplaceUtils(); findAndReplaceUtils.ReplaceItem(mSearchConfig1, "13132424", FI, "333444"); PropertyInfo PI = FI.ItemObject.GetType().GetProperty(FI.FieldName); dynamic value = PI.GetValue(FI.ItemObject); Assert.AreEqual(value, "333444", "Int Value Validation"); }
public void ReplaceEnumValueTest() { ResetActionList(); ObservableList <FoundItem> foundItemsList = new ObservableList <FoundItem>(); List <string> ValuesToFind = new List <string>() { "FreeCommand" }; FindFieldsFromAllActionsOnBusinessFlowsList(foundItemsList, ValuesToFind, mSearchConfig1); FoundItem FI = foundItemsList[0]; FindAndReplaceUtils findAndReplaceUtils = new FindAndReplaceUtils(); findAndReplaceUtils.ReplaceItem(mSearchConfig1, "FreeCommand", FI, ActScript.eScriptAct.Script.ToString()); PropertyInfo PI = FI.ItemObject.GetType().GetProperty(FI.FieldName); dynamic value = PI.GetValue(FI.ItemObject); Assert.AreEqual(value, ActScript.eScriptAct.Script, "Enum Value Validation"); }