Ejemplo n.º 1
0
        public void ShouldUseNugetUnderHomeOnNonWindows()
        {
            var environment = EnvironmentMockBuilder.Create()
                              .AddVariable("HOME", "User Home")
                              .Build();

            var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(Platform.Linux, environment);

            result.Should().Contain(Path.Combine("User Home", ".nuget", "packages"));
        }
Ejemplo n.º 2
0
        public void ShouldUseEnvironmentVariableToGetDefaultLocation()
        {
            var environment = EnvironmentMockBuilder.Create()
                              .AddVariable("NUGET_PACKAGES", PackagesPath)
                              .Build();

            var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(Platform.Unknown, environment);

            result.Should().Contain(PackagesPath);
        }
Ejemplo n.º 3
0
        public void ShouldUseEnvironmentVariableToGetDefaultLocation()
        {
            var environment = EnvironmentMockBuilder.Create()
                              .AddVariable("NUGET_PACKAGES", PackagesPath)
                              .AddAppContextData("PROBING_DIRECTORIES", string.Empty)
                              .Build();

            var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(environment);

            result.Should().Contain(PackagesPath);
        }
Ejemplo n.º 4
0
        public void ShouldUseEnvironmentVariableToGetDefaultLocation()
        {
            var environment = EnvironmentMockBuilder.Create()
                              .AddVariable("NUGET_PACKAGES", PackagesPath)
                              .Build();

            var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(environment);

            // The host for .NET Core 2.0 always sets the PROBING_DIRECTORIES property on the AppContext. Because of that,
            // no additional package directories should be returned from this, even if they are set as environment variables.
            result.Should().NotContain(PackagesPath);
        }
Ejemplo n.º 5
0
        public void ShouldUseNugetUnderHomeOnNonWindows()
        {
            var environment = EnvironmentMockBuilder.Create()
                              .SetIsWindows(false)
                              .AddVariable("HOME", "User Home")
                              .AddAppContextData("PROBING_DIRECTORIES", string.Empty)
                              .Build();

            var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(environment);

            result.Should().Contain(Path.Combine("User Home", ".nuget", "packages"));
        }
Ejemplo n.º 6
0
        public void ShouldUseNugetUnderHomeOnNonWindows()
        {
            var environment = EnvironmentMockBuilder.Create()
                              .AddVariable("HOME", "User Home")
                              .Build();

            var result = PackageCompilationAssemblyResolver.GetDefaultProbeDirectories(Platform.Linux, environment);

            // The host for .NET Core 2.0 always sets the PROBING_DIRECTORIES property on the AppContext. Because of that,
            // no additional package directories should be returned from this, even if they are set as environment variables.
            result.Should().NotContain(Path.Combine("User Home", ".nuget", "packages"));
        }