public void CanDetermineSomeRandomMapping() { // arrange service = new DetermineDestinationFromConfigurationSection(); // act var endpointForSomeMessageType = service.GetEndpointFor(typeof(SomeMessageType)); var endpointForAnotherMessageType = service.GetEndpointFor(typeof(AnotherMessageType)); // assert endpointForSomeMessageType.ShouldBe("some_message_endpoint"); endpointForAnotherMessageType.ShouldBe("another_message_endpoint"); }
public void ThrowsWhenMappingCannotBeFound() { // arrange service = new DetermineDestinationFromConfigurationSection(); // act // assert var exception = Assert.Throws<InvalidOperationException>(() => service.GetEndpointFor(typeof (string))); exception.Message.ShouldContain("System.String"); }