Skip to content

Commit e828ea4

Browse files
test: assert no indexable route starts with api/ prefix
Replace specific controller-name substring checks with a single assertion that no route starts with 'api/' -- matches the actual filter behavior and catches any future API controller added outside those specific names.
1 parent 859502b commit e828ea4

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

EssentialCSharp.Web.Tests/RouteConfigurationServiceTests.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,9 @@ public async Task GetIndexableRoutes_ShouldExcludeApiControllerRoutes()
4444
return routeConfigurationService.GetIndexableRoutes().ToList();
4545
});
4646

47-
// Assert - API routes should NOT be included
48-
await Assert.That(routes).DoesNotContain(route =>
49-
route.Contains("api/chat", StringComparison.OrdinalIgnoreCase));
50-
await Assert.That(routes).DoesNotContain(route =>
51-
route.Contains("api/listingsourcecode", StringComparison.OrdinalIgnoreCase));
52-
await Assert.That(routes).DoesNotContain(route =>
53-
route.Contains("api/mcptoken", StringComparison.OrdinalIgnoreCase));
47+
// Assert - no indexable route should start with api/ (matches the actual filter behavior)
48+
await Assert.That(routes).DoesNotContain(route =>
49+
route.StartsWith("api/", StringComparison.OrdinalIgnoreCase));
5450
}
5551

5652
[Test]

0 commit comments

Comments
 (0)