Skip to content

Commit 7391e17

Browse files
committed
xunit v3
1 parent 55d2413 commit 7391e17

34 files changed

Lines changed: 112 additions & 107 deletions

claude.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ DiffEngine is a library that manages launching and cleanup of diff tools for sna
6666
- Tool discovery uses wildcard path matching (`WildcardFileFinder`) to find executables in common install locations
6767
- Tool order can be customized via `DiffEngine_ToolOrder` environment variable
6868
- `DisabledChecker` respects `DiffEngine_Disabled` env var
69-
- Tests use xUnit with XunitContext and Verify for snapshot testing
69+
- Tests use xUnit and Verify for snapshot testing

docs/diff-tool.custom.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var resolvedTool = DiffTools.AddTool(
2525
exePath: diffToolPath,
2626
binaryExtensions: [".jpg"])!;
2727
```
28-
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L15-L30' title='Snippet source file'>snippet source</a> | <a href='#snippet-AddTool' title='Start of snippet'>anchor</a></sup>
28+
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L17-L32' title='Snippet source file'>snippet source</a> | <a href='#snippet-AddTool' title='Start of snippet'>anchor</a></sup>
2929
<!-- endSnippet -->
3030

3131
Add a tool based on existing resolved tool:
@@ -40,7 +40,7 @@ var resolvedTool = DiffTools.AddToolBasedOn(
4040
Left: (temp, target) => $"\"custom args \"{target}\" \"{temp}\"",
4141
Right: (temp, target) => $"\"custom args \"{temp}\" \"{target}\""))!;
4242
```
43-
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L86-L95' title='Snippet source file'>snippet source</a> | <a href='#snippet-AddToolBasedOn' title='Start of snippet'>anchor</a></sup>
43+
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L88-L97' title='Snippet source file'>snippet source</a> | <a href='#snippet-AddToolBasedOn' title='Start of snippet'>anchor</a></sup>
4444
<!-- endSnippet -->
4545

4646

@@ -53,7 +53,7 @@ New tools are added to the top of the order, the last tool added will resolve be
5353
```cs
5454
await DiffRunner.LaunchAsync(tempFile, targetFile);
5555
```
56-
<sup><a href='/src/DiffEngine.Tests/DiffRunnerTests.cs#L63-L67' title='Snippet source file'>snippet source</a> | <a href='#snippet-DiffRunnerLaunch' title='Start of snippet'>anchor</a></sup>
56+
<sup><a href='/src/DiffEngine.Tests/DiffRunnerTests.cs#L65-L69' title='Snippet source file'>snippet source</a> | <a href='#snippet-DiffRunnerLaunch' title='Start of snippet'>anchor</a></sup>
5757
<!-- endSnippet -->
5858

5959
Alternatively the instance returned from `AddTool*` can be used to explicitly launch that tool.
@@ -70,7 +70,7 @@ var resolvedTool = DiffTools.AddToolBasedOn(
7070

7171
await DiffRunner.LaunchAsync(resolvedTool!, "PathToTempFile", "PathToTargetFile");
7272
```
73-
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L100-L111' title='Snippet source file'>snippet source</a> | <a href='#snippet-AddToolAndLaunch' title='Start of snippet'>anchor</a></sup>
73+
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L102-L113' title='Snippet source file'>snippet source</a> | <a href='#snippet-AddToolAndLaunch' title='Start of snippet'>anchor</a></sup>
7474
<!-- endSnippet -->
7575

7676

docs/diff-tool.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ This value can also be set using [the DiffEngineTray options dialog](/docs/tray.
6363
```cs
6464
DiffRunner.MaxInstancesToLaunch(10);
6565
```
66-
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L6-L8' title='Snippet source file'>snippet source</a> | <a href='#snippet-MaxInstancesToLaunch' title='Start of snippet'>anchor</a></sup>
66+
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L8-L10' title='Snippet source file'>snippet source</a> | <a href='#snippet-MaxInstancesToLaunch' title='Start of snippet'>anchor</a></sup>
6767
<!-- endSnippet -->
6868

6969

docs/diff-tool.order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ For example `VisualStudio,Meld` will result in VisualStudio then Meld then all o
5353
```cs
5454
DiffTools.UseOrder(DiffTool.VisualStudio, DiffTool.AraxisMerge);
5555
```
56-
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L189-L193' title='Snippet source file'>snippet source</a> | <a href='#snippet-UseOrder' title='Start of snippet'>anchor</a></sup>
56+
<sup><a href='/src/DiffEngine.Tests/DiffToolsTest.cs#L191-L195' title='Snippet source file'>snippet source</a> | <a href='#snippet-UseOrder' title='Start of snippet'>anchor</a></sup>
5757
<!-- endSnippet -->

readme.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ A tool can be launched using the following:
100100
```cs
101101
await DiffRunner.LaunchAsync(tempFile, targetFile);
102102
```
103-
<sup><a href='/src/DiffEngine.Tests/DiffRunnerTests.cs#L63-L67' title='Snippet source file'>snippet source</a> | <a href='#snippet-DiffRunnerLaunch' title='Start of snippet'>anchor</a></sup>
103+
<sup><a href='/src/DiffEngine.Tests/DiffRunnerTests.cs#L65-L69' title='Snippet source file'>snippet source</a> | <a href='#snippet-DiffRunnerLaunch' title='Start of snippet'>anchor</a></sup>
104104
<!-- endSnippet -->
105105

106106
Note that this method will respect the above [difference behavior](/docs/diff-tool.md#detected-difference-behavior) in terms of Auto refresh and MDI behaviors.
@@ -115,7 +115,7 @@ A tool can be closed using the following:
115115
```cs
116116
DiffRunner.Kill(file1, file2);
117117
```
118-
<sup><a href='/src/DiffEngine.Tests/DiffRunnerTests.cs#L76-L80' title='Snippet source file'>snippet source</a> | <a href='#snippet-DiffRunnerKill' title='Start of snippet'>anchor</a></sup>
118+
<sup><a href='/src/DiffEngine.Tests/DiffRunnerTests.cs#L78-L82' title='Snippet source file'>snippet source</a> | <a href='#snippet-DiffRunnerKill' title='Start of snippet'>anchor</a></sup>
119119
<!-- endSnippet -->
120120

121121
Note that this method will respect the above [difference behavior](/docs/diff-tool.md#detected-difference-behavior) in terms of MDI behavior.
@@ -159,7 +159,7 @@ var isGoDc = BuildServerDetector.IsGoDc;
159159
var isDocker = BuildServerDetector.IsDocker;
160160
var isAppVeyor = BuildServerDetector.IsAppVeyor;
161161
```
162-
<sup><a href='/src/DiffEngine.Tests/BuildServerDetectorTest.cs#L9-L23' title='Snippet source file'>snippet source</a> | <a href='#snippet-BuildServerDetectorProps' title='Start of snippet'>anchor</a></sup>
162+
<sup><a href='/src/DiffEngine.Tests/BuildServerDetectorTest.cs#L8-L22' title='Snippet source file'>snippet source</a> | <a href='#snippet-BuildServerDetectorProps' title='Start of snippet'>anchor</a></sup>
163163
<!-- endSnippet -->
164164

165165

@@ -203,7 +203,7 @@ public async Task SetDetectedDoesNotLeakToOtherContexts()
203203
Assert.Equal(parentValue, BuildServerDetector.Detected);
204204
}
205205
```
206-
<sup><a href='/src/DiffEngine.Tests/BuildServerDetectorTest.cs#L28-L63' title='Snippet source file'>snippet source</a> | <a href='#snippet-BuildServerDetectorDetectedOverride' title='Start of snippet'>anchor</a></sup>
206+
<sup><a href='/src/DiffEngine.Tests/BuildServerDetectorTest.cs#L27-L62' title='Snippet source file'>snippet source</a> | <a href='#snippet-BuildServerDetectorDetectedOverride' title='Start of snippet'>anchor</a></sup>
207207
<!-- endSnippet -->
208208

209209

@@ -227,7 +227,7 @@ var isCursor = AiCliDetector.IsCursor;
227227
var isAider = AiCliDetector.IsAider;
228228
var isClaudeCode = AiCliDetector.IsClaudeCode;
229229
```
230-
<sup><a href='/src/DiffEngine.Tests/AiCliDetectorTest.cs#L9-L16' title='Snippet source file'>snippet source</a> | <a href='#snippet-AiCliDetectorProps' title='Start of snippet'>anchor</a></sup>
230+
<sup><a href='/src/DiffEngine.Tests/AiCliDetectorTest.cs#L8-L15' title='Snippet source file'>snippet source</a> | <a href='#snippet-AiCliDetectorProps' title='Start of snippet'>anchor</a></sup>
231231
<!-- endSnippet -->
232232

233233

src/DiffEngine.Tests/AiCliDetectorTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
public class AiCliDetectorTest(ITestOutputHelper output) :
2-
XunitContextBase(output)
1+
public class AiCliDetectorTest
32
{
43
[Fact]
54
public void Props()

src/DiffEngine.Tests/BuildServerDetectorTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
public class BuildServerDetectorTest(ITestOutputHelper output) :
2-
XunitContextBase(output)
1+
public class BuildServerDetectorTest
32
{
43
[Fact]
54
public void Props()
@@ -61,4 +60,4 @@ await Task.Run(() =>
6160
}
6261

6362
#endregion
64-
}
63+
}

src/DiffEngine.Tests/DefinitionsTest.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
public class DefinitionsTest(ITestOutputHelper output) :
2-
XunitContextBase(output)
1+
public class DefinitionsTest
32
{
3+
static string SourceDirectory { get; } = Path.GetDirectoryName(GetSourceFile())!;
4+
static string GetSourceFile([CallerFilePath] string path = "") => path;
5+
46
[Fact]
57
public void WriteList()
68
{
@@ -249,4 +251,4 @@ static void WritePaths(string exeName, string pathCommandName, TextWriter writer
249251

250252
writer.WriteLine($" * `%PATH%{pathCommandName}`");
251253
}
252-
}
254+
}

src/DiffEngine.Tests/DiffEngine.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<PackageReference Include="Xunit" />
1515
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
1616
<PackageReference Include="ProjectDefaults" PrivateAssets="all" />
17-
<PackageReference Include="XunitContext" />
1817
<ProjectReference Include="..\DiffEngine\DiffEngine.csproj" />
1918
<Compile Remove="DefinitionsTest.cs" Condition="'$(TargetFramework)' == 'net9.0'" />
2019
</ItemGroup>

src/DiffEngine.Tests/DiffEngineTrayTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#pragma warning disable CS0618 // Type or member is obsolete
2-
public class DiffEngineTrayTest(ITestOutputHelper output) :
3-
XunitContextBase(output)
1+
#pragma warning disable CS0618 // Type or member is obsolete
2+
public class DiffEngineTrayTest
43
{
54
[Fact]
65
public void IsRunning() =>

0 commit comments

Comments
 (0)