Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
fix: warning about possible null ref, we want to test exactly that
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelRauber committed Mar 11, 2024
1 parent 58ad0f4 commit ca924d1
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ public void TryAddLazy_DoesAddItemToDictionary_IfKeyIsNew()
[Test]
public void TryAddLazy_DoesThrow_IfDictionaryIsNull()
{
var sut = new Dictionary<int, string>();
sut = null;
Dictionary<int, string>? sut = null;

var newEntry = 2;
TestDelegate action = () => sut.TryAddLazy(newEntry, () => newEntry.ToString());
TestDelegate action = () => sut!.TryAddLazy(newEntry, () => newEntry.ToString());

Assert.Throws<NullReferenceException>(action);
}
Expand Down

0 comments on commit ca924d1

Please sign in to comment.