public void TestIfHelpAsked() { result = SetupMockInputResult("--help"); var rpc = new RunParameterChecker(fakeOutput, result, appsb); rpc.ParametersAreValid().Should().BeFalse(); rpc.Errs.Count.Should().Be(0); }
public void TestIfFormatExceptionIsHandled() { result = SetupMockInputResult("--lalala"); result.HelpAsked = false; result.Errors.Clear(); readMock.Setup(x => x.ReadJSONFile()).Throws(new FormatException()); var rpc = new RunParameterChecker(fakeOutput, result, appsb); rpc.ParametersAreValid().Should().BeFalse(); rpc.Errs.Should().BeEquivalentTo("Error reading JSON file"); }
public void TestWrongArgument() { List <string> errorList = new List <string>() { nameof(ArgErrorType.WrongCommand), nameof(ArgErrorType.WrongInputDirectory) }; result = SetupMockInputResult("--privet druzja"); var rpc = new RunParameterChecker(fakeOutput, result, appsb); rpc.ParametersAreValid().Should().BeFalse(); rpc.Errs.Should().BeEquivalentTo(errorList); }