Nimbus.Infrastructure.PathFactory.TopicPathFor C# (CSharp) Method

TopicPathFor() public method

public TopicPathFor ( Type type ) : string
type System.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;
        }

Usage Example

コード例 #1
0
ファイル: PathFactoryTests.cs プロジェクト: NimbusAPI/Nimbus
 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);
 }
All Usage Examples Of Nimbus.Infrastructure.PathFactory::TopicPathFor