Skip to content

Commit 7277216

Browse files
committed
Remove redundant null-forgiving operators
Eliminated unnecessary null-forgiving operators in DiffToolsTest assertions (e.g. changed tool1!.Name to tool1.Name across several asserts). Also added the missing newline at end of file. Minor cleanup to improve readability and align with nullable analysis.
1 parent 1b98db0 commit 7277216

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/DiffEngine.Tests/DiffToolsTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,19 +237,19 @@ public void TryFindByName_IsCaseInsensitive()
237237

238238
// Exact case
239239
Assert.True(DiffTools.TryFindByName("MyCaseSensitiveTool", out var tool1));
240-
Assert.Equal("MyCaseSensitiveTool", tool1!.Name);
240+
Assert.Equal("MyCaseSensitiveTool", tool1.Name);
241241

242242
// All lowercase
243243
Assert.True(DiffTools.TryFindByName("mycasesensitivetool", out var tool2));
244-
Assert.Equal("MyCaseSensitiveTool", tool2!.Name);
244+
Assert.Equal("MyCaseSensitiveTool", tool2.Name);
245245

246246
// All uppercase
247247
Assert.True(DiffTools.TryFindByName("MYCASESENSITIVETOOL", out var tool3));
248-
Assert.Equal("MyCaseSensitiveTool", tool3!.Name);
248+
Assert.Equal("MyCaseSensitiveTool", tool3.Name);
249249

250250
// Mixed case
251251
Assert.True(DiffTools.TryFindByName("myCASEsensitiveTOOL", out var tool4));
252-
Assert.Equal("MyCaseSensitiveTool", tool4!.Name);
252+
Assert.Equal("MyCaseSensitiveTool", tool4.Name);
253253
}
254254

255255
[Fact]
@@ -291,4 +291,4 @@ public void AddTool_RejectsDuplicateNameCaseInsensitive()
291291
public DiffToolsTest(ITestOutputHelper output) :
292292
base(output) =>
293293
DiffTools.Reset();
294-
}
294+
}

0 commit comments

Comments
 (0)