Ejemplo n.º 1
0
        public void TestIfHelpAsked()
        {
            result = SetupMockInputResult("--help");

            var rpc = new RunParameterChecker(fakeOutput, result, appsb);

            rpc.ParametersAreValid().Should().BeFalse();
            rpc.Errs.Count.Should().Be(0);
        }
Ejemplo n.º 2
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");
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public CheckConfig(IPathManager pathManager, RunParameterChecker parameters)
 {
     PathManager   = pathManager;
     RunParameters = parameters;
 }