public void PackageUpgrade_PackageIsNotInstalled() { NugetPackage installedPackage = null; NugetPackage newPackage = new NugetPackage(Path.Combine(sourcePath, bigFilesPackages)); EmbeddedResourceExtensions.CopyEmbeddedResource(namespaceForEmbbededResources, bigFilesPackages, sourcePath); Stopwatch stopwatch = Stopwatch.StartNew(); newPackage.Upgrade(NullLogger.Instance, new DeploymentComponentFactory(new HoneyInstallLocation(), new PathInstallLocation(targetPath)), installedPackage); stopwatch.Stop(); Console.WriteLine($"Install takes {stopwatch.ElapsedMilliseconds } ms."); Assert.That(File.Exists(Path.Combine(targetPath, "dhbx2w3k.3tc")), Is.True); }
public void PackageUpgrade_PackageIsChanged() { NugetPackage installedPackage = null; NugetPackage newPackage = new NugetPackage(Path.Combine(sourcePath, bigFilesPackages)); EmbeddedResourceExtensions.CopyEmbeddedResource(namespaceForEmbbededResources, bigFilesPackages, sourcePath); EmbeddedResourceExtensions.CopyEmbeddedResource(namespaceForEmbbededResources, bigFilesPackages2, sourcePath); newPackage.Upgrade(NullLogger.Instance, new DeploymentComponentFactory(new HoneyInstallLocation(), new PathInstallLocation(targetPath)), installedPackage); installedPackage = newPackage; NugetPackage newPackage2 = new NugetPackage(Path.Combine(sourcePath, bigFilesPackages2)); Console.WriteLine("Begin of performance calculation"); Stopwatch stopwatch = Stopwatch.StartNew(); newPackage2.Upgrade(NullLogger.Instance, new DeploymentComponentFactory(new HoneyInstallLocation(), new PathInstallLocation(targetPath)), installedPackage); stopwatch.Stop(); Console.WriteLine($"Upgrade with one file removed and one added takes {stopwatch.ElapsedMilliseconds } ms."); Assert.That(File.Exists(Path.Combine(targetPath, "dhbx2w3k.3tc")), Is.False); Assert.That(File.Exists(Path.Combine(targetPath, "dhbx2w3k.4tc")), Is.True); }
public string ExtractProtobufModel(string embeddedResourceName) { CreateTestCaseDataPath(); EmbeddedResourceExtensions.CopyEmbeddedResource(namespaceForEmbbededResources, embeddedResourceName, testCaseDataPath); return(Path.Combine(testCaseDataPath, embeddedResourceName)); }