Skip to content

Commit

Permalink
Added xunit3 projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
nscheibe committed Dec 20, 2024
1 parent c898095 commit d275486
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 21 deletions.
3 changes: 2 additions & 1 deletion src/Snapshooter.Xunit3/Snapshooter.Xunit3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit.v3" />
<PackageReference Include="xunit.v3.core" />
<PackageReference Include="xunit.v3.assert" />
</ItemGroup>

<ItemGroup>
Expand Down
29 changes: 29 additions & 0 deletions src/Snapshooter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Snapshooter.TUnit", "Snapsh
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Snapshooter.TUnit.Tests", "..\test\Snapshooter.TUnit.Tests\Snapshooter.TUnit.Tests.csproj", "{8B65FDBB-A430-406E-8992-1B4474D99358}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Snapshooter.Xunit3", "Snapshooter.Xunit3\Snapshooter.Xunit3.csproj", "{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Snapshooter.Xunit3.Tests", "..\test\Snapshooter.Xunit3.Tests\Snapshooter.Xunit3.Tests.csproj", "{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -226,6 +230,30 @@ Global
{8B65FDBB-A430-406E-8992-1B4474D99358}.Release|x64.Build.0 = Release|Any CPU
{8B65FDBB-A430-406E-8992-1B4474D99358}.Release|x86.ActiveCfg = Release|Any CPU
{8B65FDBB-A430-406E-8992-1B4474D99358}.Release|x86.Build.0 = Release|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Debug|x64.ActiveCfg = Debug|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Debug|x64.Build.0 = Debug|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Debug|x86.ActiveCfg = Debug|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Debug|x86.Build.0 = Debug|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Release|Any CPU.Build.0 = Release|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Release|x64.ActiveCfg = Release|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Release|x64.Build.0 = Release|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Release|x86.ActiveCfg = Release|Any CPU
{F5A142A6-B4A6-4D4E-B4DC-E9744012ACBC}.Release|x86.Build.0 = Release|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Debug|x64.ActiveCfg = Debug|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Debug|x64.Build.0 = Debug|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Debug|x86.ActiveCfg = Debug|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Debug|x86.Build.0 = Debug|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Release|Any CPU.Build.0 = Release|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Release|x64.ActiveCfg = Release|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Release|x64.Build.0 = Release|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Release|x86.ActiveCfg = Release|Any CPU
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -240,6 +268,7 @@ Global
{A9A09C8D-E9D1-45CC-80F1-3C8DDF8F2600} = {F9DFF684-4ACF-45E4-B23E-E8928DE0C9FE}
{3C7A875E-7B9C-45E6-93E1-E952F08758B4} = {F9DFF684-4ACF-45E4-B23E-E8928DE0C9FE}
{8B65FDBB-A430-406E-8992-1B4474D99358} = {F9DFF684-4ACF-45E4-B23E-E8928DE0C9FE}
{C23B4BBB-3A91-4D43-A8C9-69B7B4F7F7A6} = {F9DFF684-4ACF-45E4-B23E-E8928DE0C9FE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2F64A2AB-ACA2-4E2D-B7E2-B87E93C66A24}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Snapshooter.Exceptions;
using Snapshooter.Tests.Data;
using Xunit;
using Xunit.Sdk;

namespace Snapshooter.Xunit3.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static SnapshotFullName ResolveSnapshotDefaultFullName()
{
var snapshotFullNameResolver =
new SnapshotFullNameResolver(
new XunitSnapshotFullNameReader());
new Xunit3SnapshotFullNameReader());

SnapshotFullName snapshotFullName =
snapshotFullNameResolver.ResolveSnapshotFullName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void Match_AssertEqualGuidValueFailsWithinFirstSnapshotCreation_ThrowsSna
{
// arrange
var snapshotFullNameResolver = new SnapshotFullNameResolver(
new XunitSnapshotFullNameReader());
new Xunit3SnapshotFullNameReader());

SnapshotFullName snapshotFullName =
snapshotFullNameResolver.ResolveSnapshotFullName();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using System;
using System.IO;
using System.Net;
using FluentAssertions;
using Snapshooter.Tests.Data;
using Snapshooter.Xunit3.Tests.Helpers;
using Xunit;
using Xunit3.Sdk;
using Xunit.Sdk;

namespace Snapshooter.Xunit3.Tests.MatchOptions.ExcludeField;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Snapshooter.Tests.Data;
using Snapshooter.Xunit3.Tests.Helpers;
using Xunit;
using Xunit3.Sdk;
using Xunit.Sdk;

namespace Snapshooter.Xunit3.Tests.MatchOptions.HashField
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public void Match_IsTypeIntFailsWithinFirstSnapshotCreation_ThrowsSnapshotFieldE
{
// arrange
var snapshotFullNameResolver = new SnapshotFullNameResolver(
new XunitSnapshotFullNameReader());
new Xunit3SnapshotFullNameReader());

SnapshotFullName snapshotFullName =
snapshotFullNameResolver.ResolveSnapshotFullName();
Expand Down
4 changes: 4 additions & 0 deletions test/Snapshooter.Xunit3.Tests/Snapshooter.Xunit3.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@
<Folder Include="MatchOptions\IncludeField\__snapshots__\__mismatch__\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit.v3" Version="1.0.0" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions test/Snapshooter.Xunit3.Tests/SnapshotTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Snapshooter.Tests.Data;
using Snapshooter.Xunit3.Tests.Helpers;
using Xunit;
using Xunit3.Sdk;
using Xunit.Sdk;

namespace Snapshooter.Xunit3.Tests;

Expand Down Expand Up @@ -57,7 +57,7 @@ public void Match_FactMatchNewSingleSnapshot_ExpectedSnapshotHasBeenCreated()
{
// arrange
var snapshotFullNameResolver = new SnapshotFullNameResolver(
new XunitSnapshotFullNameReader());
new Xunit3SnapshotFullNameReader());

SnapshotFullName snapshotFullName =
snapshotFullNameResolver.ResolveSnapshotFullName();
Expand Down Expand Up @@ -130,7 +130,7 @@ public void Match_TheoryMatchNewSingleSnapshot_ExpectedSnapshotHasBeenCreated(in
{
// arrange
var snapshotFullNameResolver = new SnapshotFullNameResolver(
new XunitSnapshotFullNameReader());
new Xunit3SnapshotFullNameReader());

SnapshotFullName snapshotFullName =
snapshotFullNameResolver.ResolveSnapshotFullName();
Expand Down Expand Up @@ -453,7 +453,7 @@ public void Match_IgnoreFieldFailsWithinFirstSnapshotCreation_ThrowsSnapshotFiel
{
// arrange
var snapshotFullNameResolver = new SnapshotFullNameResolver(
new XunitSnapshotFullNameReader());
new Xunit3SnapshotFullNameReader());

SnapshotFullName snapshotFullName =
snapshotFullNameResolver.ResolveSnapshotFullName();
Expand Down Expand Up @@ -484,7 +484,7 @@ public void Match_IgnoreFieldNewSingleSnapshot_ExpectedSnapshotHasBeenCreated()
{
// arrange
var snapshotFullNameResolver = new SnapshotFullNameResolver(
new XunitSnapshotFullNameReader());
new Xunit3SnapshotFullNameReader());

SnapshotFullName snapshotFullName =
snapshotFullNameResolver.ResolveSnapshotFullName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;
using System.IO;
using Xunit;
using Xunit3.Sdk;
using Xunit.Sdk;

namespace Snapshooter.Xunit3.Tests.Subfolder;

Expand Down
6 changes: 3 additions & 3 deletions test/Snapshooter.Xunit3.Tests/Xunit3AssertTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Xunit;
using System;
using Xunit3.Sdk;
using Xunit.Sdk;

namespace Snapshooter.Xunit3.Tests;

Expand All @@ -10,7 +10,7 @@ public class XunitAssertTests
public void Assert_AssertEqualText_AssertSuccessful()
{
// arrange
var snapshotAssert = new XunitAssert();
var snapshotAssert = new Xunit3Assert();

// act & assert
snapshotAssert.Assert("{Same}", "{Same}");
Expand All @@ -20,7 +20,7 @@ public void Assert_AssertEqualText_AssertSuccessful()
public void Assert_AssertUnequalText_ThrowsEqualException()
{
// arrange
var snapshotAssert = new XunitAssert();
var snapshotAssert = new Xunit3Assert();

// act
Action action = () => snapshotAssert.Assert("{Same}", "{Sme}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class XunitSnapshotFullNameReaderTests
public void ReadSnapshotFullName_ResolveSnapshotFileName_ResolvedSuccessfully()
{
// arrange
var snapshotFullNameResolver = new XunitSnapshotFullNameReader();
var snapshotFullNameResolver = new Xunit3SnapshotFullNameReader();

// act
SnapshotFullName snapshotFullName = snapshotFullNameResolver.ReadSnapshotFullName();
Expand All @@ -25,7 +25,7 @@ public void ReadSnapshotFullName_ResolveSnapshotFileName_ResolvedSuccessfully()
public async Task ReadSnapshotFullName_ResolveFactSnapshotNameAsync_ResolvedSuccessfully()
{
// arrange
var snapshotFullNameResolver = new XunitSnapshotFullNameReader();
var snapshotFullNameResolver = new Xunit3SnapshotFullNameReader();
await Task.Delay(1);

// act
Expand All @@ -49,7 +49,7 @@ public void ReadSnapshotFullName_ResolveTheorySnapshotName_NameResolvedWithoutIn
string param1, int param2)
{
// arrange
var snapshotFullNameResolver = new XunitSnapshotFullNameReader();
var snapshotFullNameResolver = new Xunit3SnapshotFullNameReader();

// act
SnapshotFullName snapshotFullName = snapshotFullNameResolver.ReadSnapshotFullName();
Expand All @@ -69,7 +69,7 @@ public async Task ReadSnapshotFullName_ResolveTheorySnapshotNameAsync_NameResolv
string param1, int param2)
{
// arrange
var snapshotFullNameResolver = new XunitSnapshotFullNameReader();
var snapshotFullNameResolver = new Xunit3SnapshotFullNameReader();
await Task.Delay(1);

// act
Expand Down
1 change: 0 additions & 1 deletion test/TestProject.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<TargetFrameworks>$(TestProjectTargetFrameworks)</TargetFrameworks>
<RootNamespace>Snapshooter</RootNamespace>
<IsPackable>false</IsPackable>
<LangVersion>11.0</LangVersion>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit d275486

Please sign in to comment.