Nimbus.Infrastructure.PathFactory.DeadLetterOfficePath C# (CSharp) Метод

DeadLetterOfficePath() публичный Метод

public DeadLetterOfficePath ( ) : string
Результат string
        public string DeadLetterOfficePath()
        {
            var unsanitizedPath = $"{_globalPrefix}{_deadLetterOfficePath}";
            var sanitizedPath = Sanitize(unsanitizedPath);
            var path = Shorten(sanitizedPath, MaxPathLength);
            return path;
        }

Usage Example

Пример #1
0
        public void WhenCreatingADeadLetterQueueForATypeWithAVeryLongName_WeShouldHaveAPathOfTheCorrectMaximumLength()
        {
            var prefix = new string('x', 250);
            var pathFactory = new PathFactory(new GlobalPrefixSetting {Value = prefix});

            var path = pathFactory.DeadLetterOfficePath();

            path.Length.ShouldBe(PathFactory.MaxPathLength);

            var expectedFullPath = $"{prefix}.deadletteroffice";
            var expectedShortenedPath = PathFactory.Shorten(expectedFullPath, PathFactory.MaxPathLength);
            path.ShouldBe(expectedShortenedPath);
        }