public void LoadCsvFileAndConvertToDictionaryThenReplaceInputWithValue() { ModelMap map = new ModelMap { ConnectTo = 0, DataType = "String", Destination = "GP_CODE", Id = 1, Processes = (IEnumerable<ModelProcess>)new List<ModelProcess> { new ModelProcess { Where = "GPCodes.csv", Make = string.Empty, ProcessAction = "Load" } }, Source = "Usual GP's Full Name" }; string input = "TOOSY, Raza (Dr)"; var factory = new AutoFactory(); IActionable process = factory.CreateInstance(map.Processes.First().ProcessAction.ToLower()); string result = process.Transform(map, map.Processes.First(), input); Assert.AreNotEqual(result, "No Code Found"); }
public void CheckToSeeIfSpacesRemoved() { var factory = new AutoFactory(); IActionable process = factory.CreateInstance(_map.Processes.First().ProcessAction.ToLower()); string testNHSNo = "121 2432 532 543 2342 234 234 324 "; string result = process.Transform(_map, _map.Processes.First(), testNHSNo); Assert.IsFalse(result.Contains(" ")); }
public void QuarterStartReturnsCorrectDataForQuarter4() { var factory = new AutoFactory(); IActionable process = factory.CreateInstance(_map.Processes.First().ProcessAction.ToLower()); string testDate = "01/12/2014"; string result = process.Transform(_map,_map.Processes.First(), testDate); Assert.AreEqual(result, "01/07/2014"); }
public void RegexAction_TestIfMatch_True_Returns_Y() { var factory = new AutoFactory(); string testData = "True"; foreach (var process in _map.Processes) { IActionable action = factory.CreateInstance(process.ProcessAction.ToLower()); testData = action.Transform(_map, process, testData); } Assert.AreEqual(testData, "Y"); }