Update just read the Google group in more detail and apparently it's a app config issue. Will update post after trying.
I was wondering if anyone knows of this issue when attempting to unit test NServiceBus.
Realise I have two initialize methods below but this is to illustrate what I am trying to do. Stack trace based on request.
(NServiceBus.LocalAddress) was not present in the dictionary. (NServiceBus.LocalAddress) was not present in the dictionary.
Other part of the stack trace I believe is a red herring complaining about InMemoryPersistence. However, there is a Google group talking about this issue too who experienced the same issue which makes me think it's more of an NServiceBus issue rather than a coding mistake.
Google group link https://groups.google.com/forum/m/#!topic/particularsoftware/424_6KCv6oI
Should mention seen these posts.
https://github.com/Particular/NServiceBus.Testing/issues/20 https://github.com/Particular/NServiceBus.Testing/commit/f761c5391b03b05d967f2e368248c72522051d59
public static class CustomInit
{
public static void Init()
{
//Previous versions of NBUS, specifically 4.6.5
//MessageConventionExtensions.IsEventTypeAction = MessageConfiguration.ForEvents();
//MessageConventionExtensions.IsCommandTypeAction = MessageConfiguration.ForCommands();
//New 5.2.0 how to setup tests
Test.Initialize(x => x.AssembliesToScan(GetAssembliesToScan()));
Test.Initialize(
x =>
{
x.Conventions().DefiningCommandsAs([my namespace]);
x.Conventions().DefiningEventsAs([my namespace]);
x.AssembliesToScan(GetAssembliesToScan());
});
}
private static IEnumerable<Assembly> GetAssembliesToScan()
{
return new[]
{
AssemblyFromType<ISomeInterface>()
};
}
}