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);
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
File.Copy(inputFile, tempFile);
|
||||
|
||||
var actual = new XmlDocument();
|
||||
@@ -38,9 +37,7 @@ namespace Squirrel.Tests.Core
|
||||
var actualTypes = GetContentTypes(actual);
|
||||
|
||||
Assert.Equal(existingTypes, actualTypes);
|
||||
}
|
||||
finally
|
||||
{
|
||||
} finally {
|
||||
File.Delete(tempFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,8 +205,7 @@ namespace Squirrel.Tests.Core
|
||||
var assemblyName = AssemblyName.GetAssemblyName(outputFile);
|
||||
Assert.Equal(1, assemblyName.Version.Major);
|
||||
Assert.Equal(5, assemblyName.Version.Minor);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
File.Delete(outputPackage);
|
||||
File.Delete(outputFile);
|
||||
}
|
||||
@@ -242,8 +241,7 @@ namespace Squirrel.Tests.Core
|
||||
var fixture = new ReleasePackage(inputPackage);
|
||||
(new DirectoryInfo(sourceDir)).Exists.ShouldBeTrue();
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
fixture.CreateReleasePackage(outputPackage, sourceDir);
|
||||
|
||||
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.Equal(1, pkg.GetLibFiles().Count());
|
||||
}
|
||||
finally
|
||||
{
|
||||
} finally {
|
||||
File.Delete(outputPackage);
|
||||
}
|
||||
}
|
||||
@@ -281,8 +277,7 @@ namespace Squirrel.Tests.Core
|
||||
var rightPackage = "Caliburn.Micro.1.5.2.nupkg";
|
||||
var rightPackagePath = IntegrationTestHelper.GetPath("fixtures", rightPackage);
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
var sourceDir = IntegrationTestHelper.GetPath("fixtures", "packages");
|
||||
(new DirectoryInfo(sourceDir)).Exists.ShouldBeTrue();
|
||||
|
||||
@@ -298,9 +293,7 @@ namespace Squirrel.Tests.Core
|
||||
.FirstOrDefault(f => f.TargetFramework == FrameworkTargetVersion.Net45);
|
||||
|
||||
Assert.NotNull(dependency);
|
||||
}
|
||||
finally
|
||||
{
|
||||
} finally {
|
||||
File.Delete(outputPackage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,8 +85,7 @@ namespace Squirrel.Tests
|
||||
"Squirrel.Core.1.0.0.0-full.nupkg",
|
||||
"Squirrel.Core.1.1.0.0-delta.nupkg",
|
||||
"Squirrel.Core.1.1.0.0-full.nupkg",
|
||||
}.ForEach(x =>
|
||||
{
|
||||
}.ForEach(x => {
|
||||
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
||||
File.Copy(path, Path.Combine(localPackages, 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.1.0.0-delta.nupkg",
|
||||
"Squirrel.Core.1.1.0.0-full.nupkg",
|
||||
}.ForEach(x =>
|
||||
{
|
||||
}.ForEach(x => {
|
||||
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
||||
File.Copy(path, Path.Combine(localPackages, x));
|
||||
});
|
||||
@@ -134,8 +132,7 @@ namespace Squirrel.Tests
|
||||
new[] {
|
||||
"Squirrel.Core.1.0.0.0-full.nupkg",
|
||||
"Squirrel.Core.1.1.0.0-full.nupkg",
|
||||
}.ForEach(x =>
|
||||
{
|
||||
}.ForEach(x => {
|
||||
var path = IntegrationTestHelper.GetPath("fixtures", x);
|
||||
File.Copy(path, Path.Combine(remotePackages, x));
|
||||
});
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace Squirrel.Tests.Core
|
||||
{
|
||||
string tempDir;
|
||||
using (Utility.WithTempDirectory(out tempDir)) {
|
||||
|
||||
for (var i = 0; i < 50; i++) {
|
||||
var directory = Path.Combine(tempDir, newId());
|
||||
CreateSampleDirectory(directory);
|
||||
@@ -64,6 +63,7 @@ namespace Squirrel.Tests.Core
|
||||
|
||||
static void CreateSampleDirectory(string directory)
|
||||
{
|
||||
Random prng = new Random();
|
||||
while (true) {
|
||||
Directory.CreateDirectory(directory);
|
||||
|
||||
@@ -73,12 +73,13 @@ namespace Squirrel.Tests.Core
|
||||
File.WriteAllText(file, Guid.NewGuid().ToString());
|
||||
}
|
||||
|
||||
if (new Random().NextDouble() > 0.5) {
|
||||
if (prng.NextDouble() > 0.5) {
|
||||
var childDirectory = Path.Combine(directory, newId());
|
||||
if (childDirectory.Length > 248) return;
|
||||
directory = childDirectory;
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user