public void ShouldNotContainKeyAndValue() { DocExampleWriter.Document(() => { var websters = new Dictionary<string, string>(); websters.Add("Chazzwazzers", "What Australians would have called a bull frog."); websters.ShouldNotContainValueForKey("Chazzwazzers", "What Australians would have called a bull frog."); }, _testOutputHelper); }
public void ShouldNotContainValueForKey_WhenTrue_ShouldNotThrow() { var dictionary = new Dictionary<string, string>(); dictionary.Add("key", "value"); dictionary.ShouldNotContainValueForKey("key", "slurpee"); }
public void ValueIsNullShouldFail() { var dictionary = new Dictionary<MyThing, MyThing> { {ThingKey, null} }; Verify.ShouldFail(() => dictionary.ShouldNotContainValueForKey(ThingKey, null, "Some additional context"), errorWithSource: @"dictionary should not contain key Shouldly.Tests.TestHelpers.MyThing (000000) with value null but does Additional Info: Some additional context", errorWithoutSource: @"[[Shouldly.Tests.TestHelpers.MyThing (000000) => null]] should not contain key Shouldly.Tests.TestHelpers.MyThing (000000) with value null but does Additional Info: Some additional context"); }