Esempio n. 1
0
        public void Setup()
        {
            var environment = FakeEnvironmentHelper.CreateFromRuntime();

            fileSystem       = new FakeFileSystem(environment);
            localRepository  = new DirectoryPath(".m2");
            remoteRepository = A.Fake <IWebClient>();

            var metadata = Encoding.UTF8.GetBytes("<metadata><versioning><latest>2.0.0</latest></versioning></metadata>");

            A.CallTo(() => remoteRepository.OpenRead(A <string> .That.EndsWith(".xml"))).ReturnsLazily(_ => new MemoryStream(metadata));
        }
        public void Setup()
        {
            environment = FakeEnvironmentHelper.CreateFromRuntime();
            fileSystem  = new FakeFileSystem(environment);
            runner      = A.Fake <IProcessRunner>();
            tools       = A.Fake <IToolLocator>();
            mavenClient = A.Fake <IMavenClient>();

            fileSystem.CreateFile(javaExecutable, FileAttributes.Normal);
            A.CallTo(() => runner.Start(A <FilePath> ._, A <ProcessSettings> ._)).Returns(A.Fake <IProcess>());
            A.CallTo(() => tools.Resolve(A <string> ._)).Returns(javaExecutable);
            A.CallTo(() => mavenClient.Resolve(A <MavenPackage> ._)).Returns("/path/to/package.jar");
        }