From b71e8b551d2aca6190dd737f0f59e40d714a1d32 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 8 Jan 2022 14:42:21 +0000 Subject: [PATCH] MarkdownSnippets documentation changes --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fb2c352a..62d75273 100644 --- a/README.md +++ b/README.md @@ -109,11 +109,15 @@ public class MyServiceConfiguration : EndpointConfiguration this.SendFailedMessagesTo("error"); this.EnableInstallers(); - this.UseTransport(new RabbitMQTransport(Topology.Conventional, "host=localhost")); + /* + * Any NServiceBus suppported transport can be used. Tests in this + * repostory are using the LearningTransport for the setup simplicity + */ + this.UseTransport(new LearningTransport()); } } ``` -snippet source | anchor +snippet source | anchor Using the above approach can be problematic when configuration values need to be read from an external source, like for example a configuration file. If this is the case the same external configuration source, most of the times with different values, needs to be available in tests too. @@ -127,19 +131,23 @@ In case configuration values need to be passed to the endpoint configuration the ```cs public static class MyServiceConfigurationBuilder { - public static EndpointConfiguration Build(string endpointName, string rabbitMqConnectionString) + public static EndpointConfiguration Build(string endpointName) { var config = new EndpointConfiguration(endpointName); config.SendFailedMessagesTo("error"); config.EnableInstallers(); - config.UseTransport(new RabbitMQTransport(Topology.Conventional, rabbitMqConnectionString)); + /* + * Any NServiceBus suppported transport can be used. Tests in this + * repostory are using the LearningTransport for the setup simplicity + */ + config.UseTransport(new LearningTransport()); return config; } } ``` -snippet source | anchor +snippet source | anchor ### Define endpoints used in each test