Skip to content

Commit eac254b

Browse files
Update CommandCollectionTests.cs
1 parent c9a41b7 commit eac254b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/ImageSharp.Web.Tests/Commands/CommandCollectionTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ public void CanRemoveCommands()
102102
Assert.Equal(kv2.Value, collection[kv2.Key]);
103103
}
104104

105+
[Fact]
106+
public void CanRemoveCommandsViaKey()
107+
{
108+
KeyValuePair<string, string> kv1 = new("a", "b");
109+
KeyValuePair<string, string> kv2 = new("c", "d");
110+
CommandCollection collection = new();
111+
112+
collection.Add(kv1);
113+
collection.Add(kv2);
114+
115+
Assert.Equal(2, collection.Count);
116+
117+
collection.Remove(kv1.Key);
118+
119+
Assert.Single(collection);
120+
Assert.Equal(kv2.Value, collection[kv2.Key]);
121+
}
122+
105123
[Fact]
106124
public void CanClearCommands()
107125
{

0 commit comments

Comments
 (0)