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

DeadLetterOfficePath() public method

public DeadLetterOfficePath ( ) : string
return string
        public string DeadLetterOfficePath()
        {
            var unsanitizedPath = $"{_globalPrefix}{_deadLetterOfficePath}";
            var sanitizedPath = Sanitize(unsanitizedPath);
            var path = Shorten(sanitizedPath, MaxPathLength);
            return path;
        }

Usage Example

Exemplo n.º 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);
        }