Пример #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");
        }
Пример #2
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");
        }