public TopicPathFor ( |
||
type | ||
return | string |
public string TopicPathFor(Type type)
{
var typeName = StripGenericQualification(type);
var unsanitizedPath = $"{_globalPrefix}{_topicPrefix}.{typeName}";
var sanitizedPath = Sanitize(unsanitizedPath);
var path = Shorten(sanitizedPath, MaxPathLength);
return path;
}
public void WhenCreatingAQueue_WeShouldConvertToLowerCase() { var pathFactory = new PathFactory(new GlobalPrefixSetting()); var path = pathFactory.TopicPathFor(typeof(MyEscapingTestMessages.EscapingTestMessage)); var expectedName = "t." + typeof(MyEscapingTestMessages.EscapingTestMessage).FullName.Replace("+", ".").ToLower(); path.ShouldBe(expectedName); }