Ejemplo n.º 1
0
        // Add a.1.0.0.nupkg and a.symbols.1.0.0.nupkg
        private static async Task AddBasicPackagesAsync(SleetTestContext testContext, Symbols service)
        {
            var pkgA = new TestNupkg("a", "1.0.0");

            pkgA.Files.Clear();
            pkgA.AddFile("lib/net45/a.dll", TestUtility.GetResource("SymbolsTestAdll").GetBytes());

            var symPkgA = new TestNupkg("a", "1.0.0");

            symPkgA.Files.Clear();
            symPkgA.AddFile("lib/net45/a.dll", TestUtility.GetResource("SymbolsTestAdll").GetBytes());
            symPkgA.AddFile("lib/net45/a.pdb", TestUtility.GetResource("SymbolsTestApdb").GetBytes());
            symPkgA.Nuspec.IsSymbolPackage = true;

            var pkgAZip   = pkgA.Save(testContext.Packages);
            var pkgAInput = testContext.GetPackageInput(pkgAZip);

            var symPkgAZip   = symPkgA.Save(testContext.Packages);
            var symPkgAInput = testContext.GetPackageInput(symPkgAZip);


            await service.AddPackageAsync(pkgAInput);

            await service.AddSymbolsPackageAsync(symPkgAInput);
        }
Ejemplo n.º 2
0
        public async Task Symbols_AddSymbolsPackageAndValidateVerifyNoFailures()
        {
            using (var testContext = new SleetTestContext())
            {
                var context = testContext.SleetContext;
                context.SourceSettings.SymbolsEnabled = true;

                var testPackage = new TestNupkg("a", "1.0.0");
                testPackage.Files.Clear();
                testPackage.AddFile("lib/net45/a.dll", TestUtility.GetResource("SymbolsTestAdll").GetBytes());
                testPackage.AddFile("lib/net45/a.pdb", TestUtility.GetResource("SymbolsTestApdb").GetBytes());
                testPackage.Nuspec.IsSymbolPackage = true;

                var zipFile      = testPackage.Save(testContext.Packages);
                var packageInput = testContext.GetPackageInput(zipFile);

                var service = new Symbols(context);
                await service.AddSymbolsPackageAsync(packageInput);

                // Validate
                var messages = await service.ValidateAsync();

                var hasErrors = messages.Any(e => e.Level == LogLevel.Error);

                hasErrors.Should().BeFalse();
            }
        }
Ejemplo n.º 3
0
        private static async Task AddPackageAsync(bool isSymbols, SleetTestContext testContext, Symbols service)
        {
            var pkgA = new TestNupkg("a", "1.0.0");

            pkgA.Files.Clear();
            pkgA.AddFile("lib/net45/a.dll", TestUtility.GetResource("SymbolsTestAdll").GetBytes());
            pkgA.AddFile("lib/net45/a.pdb", TestUtility.GetResource("SymbolsTestApdb").GetBytes());
            pkgA.Nuspec.IsSymbolPackage = isSymbols;
            var zip      = pkgA.Save(testContext.Packages);
            var pkgInput = testContext.GetPackageInput(zip);

            if (isSymbols)
            {
                await service.AddSymbolsPackageAsync(pkgInput);
            }
            else
            {
                await service.AddPackageAsync(pkgInput);
            }
        }