public void when_message_type_registry_set_it_should_be_set_in_configuration() { var configuration = new EgressApiConfiguration(); var sut = new EgressApiConfigurator(configuration); sut.WithMessageTypesRegistry <MessageTypesRegistry1>().Should().BeSameAs(sut); configuration.MessageTypesRegistryType.Should().Be <MessageTypesRegistry1>(); }
public void when_message_type_registry_set_more_than_once_it_should_fail() { var configuration = new EgressApiConfiguration(); var configurator = new EgressApiConfigurator(configuration); Action sut = () => configurator.WithMessageTypesRegistry <MessageTypesRegistry1>(); sut.Should().NotThrow(); configuration.MessageTypesRegistryType.Should().Be <MessageTypesRegistry1>(); EnsureSecondCallOfConfigurationMethodFails(sut); }