Example #1
0
        public async Task NuGetExe_Caching_DoesNotNoOp(Type type, CachingType caching, ServerType server, bool success, bool noOp)
        {
            // Arrange
            var nuGetExe = await GetNuGetExeAsync();

            // Act
            var validations = await CachingTestRunner.ExecuteAsync(
                typeof(UsesGlobalPackageFolderCopyOnEveryRunTest),
                type,
                nuGetExe,
                caching,
                server);

            // Assert
            var firstPass = true;

            foreach (var validation in validations)
            {
                validation.Assert(CachingValidationType.CommandSucceeded, true);
                validation.Assert(CachingValidationType.PackageInstalled, true);
                validation.Assert(CachingValidationType.PackageFromGlobalPackagesFolderUsed, success);
                validation.Assert(CachingValidationType.PackageFromSourceNotUsed, success);
                if (firstPass)
                {
                    firstPass = false;
                    validation.Assert(CachingValidationType.RestoreNoOp, false);
                }
                else
                {
                    validation.Assert(CachingValidationType.RestoreNoOp, noOp);
                }
            }
        }
Example #2
0
        public async Task NuGetExe_Caching_InstallsToDestinationFolder(Type type, CachingType caching, ServerType server)
        {
            // Arrange
            var nuGetExe = await GetNuGetExeAsync();

            // Act
            var validations = await CachingTestRunner.ExecuteAsync(
                typeof(InstallsToDestinationFolderTest),
                type,
                nuGetExe,
                caching,
                server);

            // Assert
            validations.Assert(CachingValidationType.CommandSucceeded, true);
            validations.Assert(CachingValidationType.PackageInstalled, true);
        }
Example #3
0
        public async Task NuGetExe_Caching_CleansUpDirectDownload(Type type, CachingType caching, ServerType server, bool success)
        {
            // Arrange
            var nuGetExe = await GetNuGetExeAsync();

            // Act
            var validations = await CachingTestRunner.ExecuteAsync(
                typeof(CleansUpDirectDownloadTest),
                type,
                nuGetExe,
                caching,
                server);

            // Assert
            validations.Assert(CachingValidationType.CommandSucceeded, true);
            validations.Assert(CachingValidationType.DirectDownloadFilesDoNotExist, success);
        }
Example #4
0
        public async Task NuGetExe_Caching_WritesToHttpCache(Type type, CachingType caching, ServerType server, bool success)
        {
            // Arrange
            var nuGetExe = await GetNuGetExeAsync();

            // Act
            var validations = await CachingTestRunner.ExecuteAsync(
                typeof(WritesToHttpCacheTest),
                type,
                nuGetExe,
                caching,
                server);

            // Assert
            validations.Assert(CachingValidationType.CommandSucceeded, true);
            validations.Assert(CachingValidationType.PackageInHttpCache, success);
        }
Example #5
0
        public async Task NuGetExe_Caching_PopulatesGlobalPackagesFolder(Type type, CachingType caching, ServerType server, bool success)
        {
            // Arrange
            var nuGetExe = await GetNuGetExeAsync();

            // Act
            var validations = await CachingTestRunner.ExecuteAsync(
                typeof(PopulatesGlobalPackagesFolderTest),
                type,
                nuGetExe,
                caching,
                server);

            // Assert
            validations.Assert(CachingValidationType.CommandSucceeded, true);
            validations.Assert(CachingValidationType.PackageInGlobalPackagesFolder, success);
        }
Example #6
0
        [InlineData(typeof(RestoreProjectJsonCommand), CachingType.NoCache | CachingType.DirectDownload, ServerType.V3, true, true)] // Should fail?
        public async Task NuGetExe_Caching_AllowsMissingPackageOnSource(Type type, CachingType caching, ServerType server, bool success, bool installed)
        {
            // Arrange
            var nuGetExe = await GetNuGetExeAsync();

            // Act
            var validations = await CachingTestRunner.ExecuteAsync(
                typeof(AllowsMissingPackageOnSourceTest),
                type,
                nuGetExe,
                caching,
                server);

            // Assert
            validations.Assert(CachingValidationType.CommandSucceeded, success);
            validations.Assert(CachingValidationType.PackageInstalled, installed);
        }
Example #7
0
        public async Task NuGetExe_Caching_UsesHttpCacheCopy(Type type, CachingType caching, ServerType server, bool success)
        {
            // Arrange
            var nuGetExe = await GetNuGetExeAsync();

            // Act
            var validations = await CachingTestRunner.ExecuteAsync(
                typeof(UsesHttpCacheCopyTest),
                type,
                nuGetExe,
                caching,
                server);

            // Assert
            validations.Assert(CachingValidationType.CommandSucceeded, true);
            validations.Assert(CachingValidationType.PackageInstalled, true);
            validations.Assert(CachingValidationType.PackageFromHttpCacheUsed, success);
            validations.Assert(CachingValidationType.PackageFromSourceNotUsed, success);
        }