public void SucceedsWhenValueIsPresentUsingContainKey() { var dictionary = new Dictionary <string, string> { { "Hello", "World" }, { "Hola", "Mundo" } }; Assert.That(dictionary, Does.ContainValue("Mundo")); }
public void Assert_does_contain_key_and_value() { var people = new Dictionary <string, int>() { ["carlos"] = 29, ["Jazzy"] = 9 }; Assert.That(people, Does.ContainKey("carlos")); Assert.That(people, Does.ContainValue(30)); }
public void AssertThat_DoesCommonlyUsed() { var valuesByCountry = new Dictionary <string, int> { { "UK", 1000 }, { "Spain", 2000 }, { "France", 3000 } }; Assert.That(valuesByCountry, Does.ContainKey("UK")); Assert.That(valuesByCountry, Does.ContainValue(3000)); }
public void Given_MultipleComponents_When_Host_Then_NewHostRegisteredWithComponents() { var componentName = "Component"; var component = A.Dummy <Components.IComponent>(); var componentSpecification = A.Dummy <IGenericHostComponentSpecification>(); A.CallTo(() => componentSpecification.Apply(A <IHostBuilder> ._)).Returns(component); A.CallTo(() => componentSpecification.Name).Returns(componentName); var spec = new GenericHostSpecification(); spec.AddComponentSpecification(componentSpecification); var host = spec.Build(); Assert.That(host, Is.Not.Null); Assert.That(host.Components, Does.ContainKey(componentName)); Assert.That(host.Components, Does.ContainValue(component)); }