示例#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);
        }
示例#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");
        }
示例#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);
        }