示例#1
0
        public void FileArgument()
        {
            string path;
            IFileService fileService = TestFileServices.CreateSubstituteForFile(out path, "a\nb\nc\n@ @ @");
            TestArgumentParser parser = new TestArgumentParser();
            parser.TestFileService = fileService;

            parser.Parse(new string[] { "Command", @"/foo:@" + path });
            parser.GetOption<string>("foo").Should().Be("a;b;c", "specified in file as a, b, c");
        }
 public void Setup()
 {
     testConsole         = new TestConsole();
     testArgumentParser  = new TestArgumentParser();
     testCommandExecutor = new Mock <ICommandExecutor>();
 }
示例#3
0
        public void FileTarget()
        {
            string path;
            IFileService fileService = TestFileServices.CreateSubstituteForFile(out path, "a\nb\nc\n@ @ @");
            TestArgumentParser parser = new TestArgumentParser();
            parser.TestFileService = fileService;

            parser.Parse(new string[] { "Command", @"@" + path });
            parser.Targets.Should().ContainInOrder("a", "b", "c");
        }