public void AddValueOrOverrideTest() { var dictionary = new Dictionary <int, int> { { 1, 2 } }; Dicts.AddValueOrOverride(dictionary, 1, 100); Dicts.AddValueOrOverride(dictionary, 2, 200); dictionary.Count.ShouldBe(2); dictionary[1].ShouldBe(100); dictionary[2].ShouldBe(200); dictionary.AddValueOrOverride(1, 300); dictionary.AddValueOrOverride(3, 400); dictionary.Count.ShouldBe(3); dictionary[1].ShouldBe(300); dictionary[2].ShouldBe(200); dictionary[3].ShouldBe(400); }