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); }
public void WhenCreatingATopicPathWithAGlobalPrefix_ThePathShouldStartWithThePrefix() { var pathFactory = new PathFactory(new GlobalPrefixSetting {Value = "testprefix"}); var path = pathFactory.TopicPathFor(typeof(SimpleEvent)); path.ShouldBe("testprefix.t.nimbus.unittests.infrastructuretests.messagecontracts.simpleevent"); }
public void WhenCreatingAQueueForANestedType_WeShouldStripOutPlusSigns() { var pathFactory = new PathFactory(new GlobalPrefixSetting()); var path = pathFactory.TopicPathFor(typeof(MyEscapingTestMessages.EscapingTestMessage)); path.ShouldNotContain("+"); }
public void WhenCreatingATopicForATypeWithAVeryLongName_WeShouldHaveAPathOfTheCorrectMaximumLength() { var prefix = new string('x', 230); var pathFactory = new PathFactory(new GlobalPrefixSetting {Value = prefix}); var path = pathFactory.TopicPathFor(typeof(SimpleEvent)); path.Length.ShouldBe(PathFactory.MaxPathLength); var expectedFullPath = $"{prefix}.t.nimbus.unittests.infrastructuretests.messagecontracts.simpleevent"; var expectedShortenedPath = PathFactory.Shorten(expectedFullPath, PathFactory.MaxPathLength); path.ShouldBe(expectedShortenedPath); }