Example #1
0
        public NuGetPackageInstallerFixture()
        {
            Environment     = FakeEnvironment.CreateUnixEnvironment();
            FileSystem      = new FakeFileSystem(Environment);
            ProcessRunner   = Substitute.For <IProcessRunner>();
            ContentResolver = Substitute.For <INuGetPackageContentResolver>();
            Log             = Substitute.For <ICakeLog>();

            ToolResolver = Substitute.For <INuGetToolResolver>();
            ToolResolver.ResolvePath().Returns(new FilePath("/Working/tools/nuget.exe"));

            Package     = new PackageReference("nuget:https://myget.org/temp/?package=Cake.Foo&prerelease&version=1.2.3");
            PackageType = PackageType.Addin;
            InstallPath = new DirectoryPath("./nuget");
        }
        public NuGetPackageInstallerFixture()
        {
            Environment     = FakeEnvironment.CreateUnixEnvironment();
            FileSystem      = new FakeFileSystem(Environment);
            ContentResolver = Substitute.For <INuGetContentResolver>();
            Log             = Substitute.For <ICakeLog>();
            Config          = Substitute.For <ICakeConfiguration>();

            ToolResolver = Substitute.For <INuGetToolResolver>();
            ToolResolver.ResolvePath().Returns(new FilePath("/Working/tools/nuget.exe"));

            Package     = new PackageReference("nuget:https://myget.org/temp/?package=Cake.Foo&prerelease&version=1.2.3");
            PackageType = PackageType.Addin;
            InstallPath = new DirectoryPath("./nuget");

            ProcessRunner = Substitute.For <IProcessRunner>();
            ProcessRunner.When(p => p.Start(Arg.Any <FilePath>(), Arg.Any <ProcessSettings>()))
            .Do(info => FileSystem.CreateDirectory(InstallPath.Combine(Package.Package.ToLowerInvariant()).Combine(Package.Package)));
        }