public void Execute_WhenArgsValid_ReturnsResultFromReader(int expectedCode) { var args = new[] { " arg1 ", "arg2" }; validatorMock.Validate(args).Returns(Constants.ErrorCodes.Success); legacyDbDumpReaderMock.ReadData("arg1").Returns(expectedCode); var actual = systemUnderTest.Execute(args); Assert.That(actual, Is.EqualTo(expectedCode)); }
public int Execute(string[] args) { loggingService.LogDebug("Begin Execution"); var result = inputValidator.Validate(args); if (result == Constants.ErrorCodes.Success) { outputPath = args[1].Trim(); result = legacyDbDumpReader.ReadData(args[0].Trim()); } loggingService.LogDebug("End Execution"); return(result); }