mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
Fix up the Test style
This commit is contained in:
@@ -26,8 +26,7 @@ namespace Squirrel.Tests.Core
|
|||||||
|
|
||||||
var existingTypes = GetContentTypes(expected);
|
var existingTypes = GetContentTypes(expected);
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
File.Copy(inputFile, tempFile);
|
File.Copy(inputFile, tempFile);
|
||||||
|
|
||||||
var actual = new XmlDocument();
|
var actual = new XmlDocument();
|
||||||
@@ -38,9 +37,7 @@ namespace Squirrel.Tests.Core
|
|||||||
var actualTypes = GetContentTypes(actual);
|
var actualTypes = GetContentTypes(actual);
|
||||||
|
|
||||||
Assert.Equal(existingTypes, actualTypes);
|
Assert.Equal(existingTypes, actualTypes);
|
||||||
}
|
} finally {
|
||||||
finally
|
|
||||||
{
|
|
||||||
File.Delete(tempFile);
|
File.Delete(tempFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,8 +205,7 @@ namespace Squirrel.Tests.Core
|
|||||||
var assemblyName = AssemblyName.GetAssemblyName(outputFile);
|
var assemblyName = AssemblyName.GetAssemblyName(outputFile);
|
||||||
Assert.Equal(1, assemblyName.Version.Major);
|
Assert.Equal(1, assemblyName.Version.Major);
|
||||||
Assert.Equal(5, assemblyName.Version.Minor);
|
Assert.Equal(5, assemblyName.Version.Minor);
|
||||||
}
|
} finally {
|
||||||
finally {
|
|
||||||
File.Delete(outputPackage);
|
File.Delete(outputPackage);
|
||||||
File.Delete(outputFile);
|
File.Delete(outputFile);
|
||||||
}
|
}
|
||||||
@@ -242,8 +241,7 @@ namespace Squirrel.Tests.Core
|
|||||||
var fixture = new ReleasePackage(inputPackage);
|
var fixture = new ReleasePackage(inputPackage);
|
||||||
(new DirectoryInfo(sourceDir)).Exists.ShouldBeTrue();
|
(new DirectoryInfo(sourceDir)).Exists.ShouldBeTrue();
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
fixture.CreateReleasePackage(outputPackage, sourceDir);
|
fixture.CreateReleasePackage(outputPackage, sourceDir);
|
||||||
|
|
||||||
this.Log().Info("Resulting package is at {0}", outputPackage);
|
this.Log().Info("Resulting package is at {0}", outputPackage);
|
||||||
@@ -264,9 +262,7 @@ namespace Squirrel.Tests.Core
|
|||||||
Assert.Contains("dir\\item-in-subdirectory.txt", contentFilePaths);
|
Assert.Contains("dir\\item-in-subdirectory.txt", contentFilePaths);
|
||||||
|
|
||||||
Assert.Equal(1, pkg.GetLibFiles().Count());
|
Assert.Equal(1, pkg.GetLibFiles().Count());
|
||||||
}
|
} finally {
|
||||||
finally
|
|
||||||
{
|
|
||||||
File.Delete(outputPackage);
|
File.Delete(outputPackage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -281,8 +277,7 @@ namespace Squirrel.Tests.Core
|
|||||||
var rightPackage = "Caliburn.Micro.1.5.2.nupkg";
|
var rightPackage = "Caliburn.Micro.1.5.2.nupkg";
|
||||||
var rightPackagePath = IntegrationTestHelper.GetPath("fixtures", rightPackage);
|
var rightPackagePath = IntegrationTestHelper.GetPath("fixtures", rightPackage);
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
var sourceDir = IntegrationTestHelper.GetPath("fixtures", "packages");
|
var sourceDir = IntegrationTestHelper.GetPath("fixtures", "packages");
|
||||||
(new DirectoryInfo(sourceDir)).Exists.ShouldBeTrue();
|
(new DirectoryInfo(sourceDir)).Exists.ShouldBeTrue();
|
||||||
|
|
||||||
@@ -298,9 +293,7 @@ namespace Squirrel.Tests.Core
|
|||||||
.FirstOrDefault(f => f.TargetFramework == FrameworkTargetVersion.Net45);
|
.FirstOrDefault(f => f.TargetFramework == FrameworkTargetVersion.Net45);
|
||||||
|
|
||||||
Assert.NotNull(dependency);
|
Assert.NotNull(dependency);
|
||||||
}
|
} finally {
|
||||||
finally
|
|
||||||
{
|
|
||||||
File.Delete(outputPackage);
|
File.Delete(outputPackage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ namespace Squirrel.Tests
|
|||||||
"Squirrel.Core.1.0.0.0-full.nupkg",
|
"Squirrel.Core.1.0.0.0-full.nupkg",
|
||||||
"Squirrel.Core.1.1.0.0-delta.nupkg",
|
"Squirrel.Core.1.1.0.0-delta.nupkg",
|
||||||
"Squirrel.Core.1.1.0.0-full.nupkg",
|
"Squirrel.Core.1.1.0.0-full.nupkg",
|
||||||
}.ForEach(x =>
|
}.ForEach(x => {
|
||||||
{
|
|
||||||
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
||||||
File.Copy(path, Path.Combine(localPackages, x));
|
File.Copy(path, Path.Combine(localPackages, x));
|
||||||
File.Copy(path, Path.Combine(remotePackages, x));
|
File.Copy(path, Path.Combine(remotePackages, x));
|
||||||
@@ -125,8 +124,7 @@ namespace Squirrel.Tests
|
|||||||
"Squirrel.Core.1.0.0.0-full.nupkg",
|
"Squirrel.Core.1.0.0.0-full.nupkg",
|
||||||
"Squirrel.Core.1.1.0.0-delta.nupkg",
|
"Squirrel.Core.1.1.0.0-delta.nupkg",
|
||||||
"Squirrel.Core.1.1.0.0-full.nupkg",
|
"Squirrel.Core.1.1.0.0-full.nupkg",
|
||||||
}.ForEach(x =>
|
}.ForEach(x => {
|
||||||
{
|
|
||||||
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
||||||
File.Copy(path, Path.Combine(localPackages, x));
|
File.Copy(path, Path.Combine(localPackages, x));
|
||||||
});
|
});
|
||||||
@@ -134,8 +132,7 @@ namespace Squirrel.Tests
|
|||||||
new[] {
|
new[] {
|
||||||
"Squirrel.Core.1.0.0.0-full.nupkg",
|
"Squirrel.Core.1.0.0.0-full.nupkg",
|
||||||
"Squirrel.Core.1.1.0.0-full.nupkg",
|
"Squirrel.Core.1.1.0.0-full.nupkg",
|
||||||
}.ForEach(x =>
|
}.ForEach(x => {
|
||||||
{
|
|
||||||
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
||||||
File.Copy(path, Path.Combine(remotePackages, x));
|
File.Copy(path, Path.Combine(remotePackages, x));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ namespace Squirrel.Tests.Core
|
|||||||
{
|
{
|
||||||
string tempDir;
|
string tempDir;
|
||||||
using (Utility.WithTempDirectory(out tempDir)) {
|
using (Utility.WithTempDirectory(out tempDir)) {
|
||||||
|
|
||||||
for (var i = 0; i < 50; i++) {
|
for (var i = 0; i < 50; i++) {
|
||||||
var directory = Path.Combine(tempDir, newId());
|
var directory = Path.Combine(tempDir, newId());
|
||||||
CreateSampleDirectory(directory);
|
CreateSampleDirectory(directory);
|
||||||
@@ -64,6 +63,7 @@ namespace Squirrel.Tests.Core
|
|||||||
|
|
||||||
static void CreateSampleDirectory(string directory)
|
static void CreateSampleDirectory(string directory)
|
||||||
{
|
{
|
||||||
|
Random prng = new Random();
|
||||||
while (true) {
|
while (true) {
|
||||||
Directory.CreateDirectory(directory);
|
Directory.CreateDirectory(directory);
|
||||||
|
|
||||||
@@ -73,12 +73,13 @@ namespace Squirrel.Tests.Core
|
|||||||
File.WriteAllText(file, Guid.NewGuid().ToString());
|
File.WriteAllText(file, Guid.NewGuid().ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new Random().NextDouble() > 0.5) {
|
if (prng.NextDouble() > 0.5) {
|
||||||
var childDirectory = Path.Combine(directory, newId());
|
var childDirectory = Path.Combine(directory, newId());
|
||||||
if (childDirectory.Length > 248) return;
|
if (childDirectory.Length > 248) return;
|
||||||
directory = childDirectory;
|
directory = childDirectory;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user