Code cleanup

This commit is contained in:
Caelan Sayler
2024-01-04 16:27:14 +00:00
parent aa96f3d8c1
commit 2e7ffeb883
68 changed files with 216 additions and 549 deletions

View File

@@ -1,13 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using Velopack;
using System.Xml;
using Velopack.NuGet;
using Velopack.Tests.TestHelpers;
using Xunit;
namespace Velopack.Tests
{

View File

@@ -1,14 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using NuGet;
using System.Diagnostics.Contracts;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using System.Collections.Concurrent;
using System.Text.RegularExpressions;
namespace Velopack.Tests.OldSquirrel
{

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Text.RegularExpressions;
namespace Velopack.Tests.OldSquirrel
{

View File

@@ -1,7 +1,4 @@

using System;
using System.ComponentModel;
using System.Globalization;
using System.Globalization;
using System.Text.RegularExpressions;
namespace Velopack.Tests.OldSquirrel

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Velopack.Tests.OldSquirrel
namespace Velopack.Tests.OldSquirrel
{
internal static class Utility
{

View File

@@ -1,11 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text;
using NuGet.Versioning;
using Velopack.Tests.TestHelpers;
using Xunit;
using OldReleaseEntry = Velopack.Tests.OldSquirrel.ReleaseEntry;
using OldSemanticVersion = Velopack.Tests.OldSquirrel.SemanticVersion;

View File

@@ -1,8 +1,4 @@
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Xunit;
using Velopack.Windows;
using Velopack.Windows;
namespace Velopack.Tests
{

View File

@@ -1,8 +1,5 @@
using System;
using System.Collections;
using System.Collections;
using System.Globalization;
using System.IO;
using Xunit;
namespace Velopack.Tests.TestHelpers
{

View File

@@ -1,7 +1,4 @@
using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Text;
namespace Velopack.Tests
{

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text;
using Velopack.Sources;
namespace Velopack.Tests.TestHelpers
@@ -47,7 +43,7 @@ namespace Velopack.Tests.TestHelpers
var rel = _releases.FirstOrDefault(r => url.EndsWith(r.OriginalFilename));
if (rel == null)
throw new Exception("Fake release not found: " + url);
var filePath = PathHelper.GetFixture(rel.OriginalFilename);
if (!File.Exists(filePath)) {
throw new NotSupportedException("FakeFixtureRepository doesn't have: " + rel.OriginalFilename);

View File

@@ -1,9 +1,5 @@
using System;
using System.IO;
using System.Net;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Velopack.Tests
{

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Text;
using NuGet.Versioning;
using Velopack.Locators;
using Velopack.Sources;
@@ -28,7 +22,7 @@ namespace Velopack.Tests
using var _1 = Utility.GetTempDirectory(out var tempPath);
string releasesSuffix = VelopackRuntimeInfo.IsOSX ? "-osx" : "";
File.WriteAllText(Path.Combine(tempPath, "RELEASES" + releasesSuffix), """
3a2eadd15dd984e4559f2b4d790ec8badaeb6a39 MyCoolApp-1.1.0.nupkg 1040561
94689fede03fed7ab59c24337673a27837f0c3ec MyCoolApp-1.0.0.nupkg 1004502

View File

@@ -1,17 +1,8 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Diagnostics;
using System.Runtime.Versioning;
using System.Security.Cryptography;
using System.Text;
using Velopack;
using Velopack.Tests.TestHelpers;
using Xunit;
using Velopack.Windows;
using System.Collections.Generic;
using Xunit.Abstractions;
using System.Threading.Tasks;
using System.Runtime.Versioning;
namespace Velopack.Tests
{
@@ -30,7 +21,7 @@ namespace Velopack.Tests
[InlineData("/file", "\\file")]
[InlineData("/file/", "\\file")]
[InlineData("one\\two\\..\\file", "one\\file")]
[InlineData("C:/AnApp/file/", "C:\\AnApp\\file")]
[InlineData("C:/AnApp/file/", "C:\\AnApp\\file")]
public void PathIsNormalized(string input, string expected)
{
Skip.IfNot(VelopackRuntimeInfo.IsWindows);

View File

@@ -1,14 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Packaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Packaging;
using NuGet.Versioning;
using Velopack.NuGet;
using Velopack.Tests.TestHelpers;
using Xunit;
using ZipPackage = Velopack.NuGet.ZipPackage;
namespace Velopack.Tests