예제 #1
0
        public void Dependencies_FindDependenciesFile()
        {
            //arrange
            var fs  = new Mock <IFileSystemProxy>();
            var cwd = Directory.GetCurrentDirectory();

            var subDir          = Path.Combine(cwd, "testing", "subdir");
            var depsFile        = Path.Combine(cwd, PaketDependencies.DEPENDENCY_FILE);
            var depsFileContent = "version 5.0.0-beta008";
            var depsFileStream  = new MemoryStream(Encoding.UTF8.GetBytes(depsFileContent));

            fs.Setup(f => f.GetCurrentDirectory()).Returns(subDir);
            fs.Setup(f => f.FileExists(It.IsAny <string>())).Returns(false);
            fs.Setup(f => f.FileExists(depsFile)).Returns(true);
            fs.Setup(f => f.OpenRead(depsFile)).Returns(depsFileStream);

            //act
            var opts      = new BootstrapperOptions();
            var argstring = PaketDependencies.GetBootstrapperArgsForFolder(fs.Object);
            var args      = WindowsProcessArguments.Parse(argstring);

            ArgumentParser.FillNonRunOptionsFromArguments(opts, args);

            //assert
            Assert.That(opts.DownloadArguments.LatestVersion, Is.EqualTo("5.0.0-beta008"));
        }
예제 #2
0
        private void Verify(string expected, params string[] argv)
        {
            var result = WindowsProcessArguments.ToString(argv);

            Assert.That(result, Is.EqualTo(expected));
        }
        private void Verify(string args, params string[] expected)
        {
            var result = WindowsProcessArguments.Parse(args);

            Assert.That(result, Is.EqualTo(expected));
        }