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"); }
public void ShouldNotContainValueForKey_WhenTrue_ShouldNotThrow() { var dictionary = new Dictionary <string, string> { { "key", "value" } }; dictionary.ShouldNotContainValueForKey("key", "slurpee"); }
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 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); }
protected override void ShouldThrowAWobbly() { _dictionary.ShouldNotContainValueForKey("Foo", "Bar"); }
protected override void ShouldThrowAWobbly() { _dictionary.ShouldNotContainValueForKey(ThingKey, ThingValue, "Some additional context"); }
public void ShouldNotContainValueForKey_WhenTrue_ShouldNotThrow() { var dictionary = new Dictionary<string, string>(); dictionary.Add("key", "value"); dictionary.ShouldNotContainValueForKey("key", "slurpee"); }
protected override void ShouldThrowAWobbly() { _dictionary.ShouldNotContainValueForKey(ThingKey, ThingValue); }
protected override void ShouldThrowAWobbly() { _dictionary.ShouldNotContainValueForKey("Bar", "Baz", "Some additional context"); }
protected override void ShouldThrowAWobbly() { _dictionary.ShouldNotContainValueForKey(GuidKey, GuidValue); }
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"); }