Skip to content

Commit

Permalink
remove Verify
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Sep 15, 2023
1 parent ea2c5da commit 736c75b
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 19 deletions.
2 changes: 0 additions & 2 deletions src/NoRefsTests/NoRefsTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
<Compile Remove="..\Tests\NamedTupleSample.cs" />
<Compile Remove="..\Tests\RangeIndexUsage.cs" />
<Compile Remove="..\Tests\PolyfillExtensionsTests_*.cs" />
<PackageReference Include="Verify.NUnit" Version="21.1.3" />
<PackageReference Include="Verify.DiffPlex" Version="2.2.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
Expand Down
2 changes: 0 additions & 2 deletions src/PublicTests/PublicTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<Link>Pollyfill\PlatformCompatibility\%(RecursiveDir)%(Filename).cs</Link>
</Compile>
<Compile Include="..\Tests\*.cs" Exclude="..\Tests\BuildApiTest.cs;..\Tests\NullabilitySync.cs" />
<PackageReference Include="Verify.NUnit" Version="21.1.3" />
<PackageReference Include="Verify.DiffPlex" Version="2.2.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/BuildApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BuildApiTest
[Test]
public void Run()
{
var solutionDirectory = VerifyTests.AttributeReader.GetSolutionDirectory();
var solutionDirectory = SolutionDirectoryFinder.Find();
var path = Path.Combine(solutionDirectory, @"Consume\bin\Debug\netstandard2.0\Consume.dll");
var md = Path.Combine(solutionDirectory, @"..\api_list.include.md");
File.Delete(md);
Expand Down
8 changes: 0 additions & 8 deletions src/Tests/ModuleInitializer.cs

This file was deleted.

3 changes: 1 addition & 2 deletions src/Tests/NullabilitySync.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#if NET8_0 && DEBUG
using System.Net.Http;
using VerifyTests;

[TestFixture]
public class NullabilitySync
{
static string solutionDir = AttributeReader.GetSolutionDirectory();
static string solutionDir = SolutionDirectoryFinder.Find();
static string dir = Path.Combine(solutionDir, "PolyFill", "Nullability");

[Test]
Expand Down
36 changes: 36 additions & 0 deletions src/Tests/SolutionDirectoryFinder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Diagnostics.CodeAnalysis;

static class SolutionDirectoryFinder
{
public static string Find([CallerFilePath] string sourceFile = "")
{
if (!TryFind(sourceFile, out var solutionDirectory))
{
throw new("Could not find solution directory");
}

return solutionDirectory;
}

public static bool TryFind(string sourceFile, [NotNullWhen(true)] out string? path)
{
var currentDirectory = sourceFile;
do
{
if (Directory.GetFiles(currentDirectory, "*.sln").Any())
{
path = currentDirectory;
return true;
}

var parent = Directory.GetParent(currentDirectory);
if (parent == null)
{
path = null;
return false;
}

currentDirectory = parent.FullName;
} while (true);
}
}
2 changes: 0 additions & 2 deletions src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
<Link>Pollyfill\PlatformCompatibility\%(RecursiveDir)%(Filename).cs</Link>
</Compile>
<PackageReference Include="Mono.Cecil" Version="0.11.5" />
<PackageReference Include="Verify.NUnit" Version="21.1.3" />
<PackageReference Include="Verify.DiffPlex" Version="2.2.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
Expand Down
2 changes: 0 additions & 2 deletions src/UnsafeTests/UnsafeTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<Link>Pollyfill\PlatformCompatibility\%(RecursiveDir)%(Filename).cs</Link>
</Compile>
<Compile Include="..\Tests\*.cs" Exclude="..\Tests\BuildApiTest.cs;..\Tests\NullabilitySync.cs" />
<PackageReference Include="Verify.NUnit" Version="21.1.3" />
<PackageReference Include="Verify.DiffPlex" Version="2.2.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
Expand Down

0 comments on commit 736c75b

Please sign in to comment.