Пример #1
0
        public void GetInputArgumentFromCommandInput()
        {
            //Given
            var commands     = "--log-dir ..\\..\\Logs --log-level Info --csv ..\\Logs --log-level Warn";
            var commandArray = commands.Split(" ");
            //When
            var inputArguments = new InputArguments();

            inputArguments.Get(commandArray);
            //Then
            var expectedArguments = new InputArguments()
            {
                LogDir    = "..\\..\\Logs",
                LogLevels = new System.Collections.Generic.List <string>()
                {
                    "Info", "Warn"
                },
                OutPath = "..\\Logs"
            };

            Assert.Equal(expectedArguments.LogDir, inputArguments.LogDir);
            Assert.Equal(expectedArguments.LogLevels, inputArguments.LogLevels);
            Assert.Equal(expectedArguments.OutPath, inputArguments.OutPath);
        }