Skip to content

Commit

Permalink
MarkdownSnippets documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user authored and mauroservienti committed Jan 8, 2022
1 parent 1d2bc46 commit b71e8b5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
```
<sup><a href='/src/Snippets/ConfigurationSnippets.cs#L5-L17' title='Snippet source file'>snippet source</a> | <a href='#snippet-inherit-from-endpoint-configuration' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Snippets/ConfigurationSnippets.cs#L5-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-inherit-from-endpoint-configuration' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

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.
Expand All @@ -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;
}
}
```
<sup><a href='/src/Snippets/ConfigurationSnippets.cs#L19-L33' title='Snippet source file'>snippet source</a> | <a href='#snippet-use-builder-class' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Snippets/ConfigurationSnippets.cs#L23-L41' title='Snippet source file'>snippet source</a> | <a href='#snippet-use-builder-class' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

### Define endpoints used in each test
Expand Down

0 comments on commit b71e8b5

Please sign in to comment.