public void TestAddIfContains() { var dictionary = new Dictionary <string, string>() { { "hello", "world" } }; LogglySink.AddIfNotContains(dictionary, "hello", "another world"); dictionary.ContainsKey("hello").Should().BeTrue(); dictionary["hello"].Should().Be("world"); LogglySink.AddIfNotContains(dictionary, "newkey", "orange"); dictionary.ContainsKey("newkey").Should().BeTrue(); dictionary["newkey"].Should().Be("orange"); }
public void TestAddIfContains() { var dictionary = new Dictionary <string, string>() { { "hello", "world" } }; LogglySink.AddIfNotContains(dictionary, "hello", "another world"); Assert.IsTrue(dictionary.ContainsKey("hello")); Assert.AreEqual(dictionary["hello"], "world"); LogglySink.AddIfNotContains(dictionary, "newkey", "orange"); Assert.IsTrue(dictionary.ContainsKey("newkey")); Assert.AreEqual(dictionary["newkey"], "orange"); }