public string SubscriptionNameFor(string applicationName, Type handlerType) { var unsanitizedName = $"{applicationName}.{handlerType.Name}"; var sanitizedName = Sanitize(unsanitizedName); var name = Shorten(sanitizedName, MaxNameLength); return name; }
public void WhenCreatingASubscriptionForATypeASpaceShouldBeConvertedToTheSanitizeCharacter() { var pathFactory = new PathFactory(new GlobalPrefixSetting()); var subscriptionName = pathFactory.SubscriptionNameFor("My App", "App server", typeof(MyEventWithALongName)); subscriptionName.ShouldBe("my.app.app.server.myeventwithalongname"); }