Skip to content

Commit 60a220f

Browse files
committed
Added MapTopicRedirect() to OnTopic.AspNetCore.Mvc.Host
This allows for integration testing of the `RedirectController` at e.g. /Topic/40/`.
1 parent a4b449d commit 60a220f

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

OnTopic.AspNetCore.Mvc.Host/SampleActivator.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ public object Create(ControllerContext context) {
102102
new TopicController(_topicRepository, _topicMappingService),
103103
nameof(SitemapController) =>
104104
new SitemapController(_topicRepository),
105+
nameof(RedirectController) =>
106+
new RedirectController(_topicRepository),
105107
_ => throw new Exception($"Unknown controller {type.Name}")
106108
};
107109

OnTopic.AspNetCore.Mvc.Host/Startup.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ public static void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
114114
app.UseEndpoints(endpoints => {
115115
endpoints.MapTopicRoute("Web");
116116
endpoints.MapTopicSitemap();
117+
endpoints.MapTopicRedirect();
117118
endpoints.MapControllers();
118119
});
119120

0 commit comments

Comments
 (0)