Path: redb-route/tests/redb.Route.Tests.Templates/TemplateModelReviewTests.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Templates/TemplateModelReviewTests.cs
----
using redb.Route.Core;
using redb.Route.Templates;
using redb.Route.TestKit;
namespace redb.Route.Tests.Templates;
/// Code review 2026-09-01: the framework's own DI-scope properties are not part of the template model.
public class TemplateModelReviewTests
{
[Fact]
public async Task Properties_DoNotExposeServiceScopes()
{
await using var ctx = new RouteContext().AddRoutes(b => b
.From("direct://props")
.SetProperty("__redb_scope:x", "leak")
.SetProperty("visible", "yes")
.SetBodyTemplate(TextSource.Inline("{{ properties | object.has_key '__redb_scope:x' }}|{{ properties.visible }}"), MediaType.Text));
await ctx.Start();
var body = await ctx.RequestBody("direct://props", "in");
body.Should().Be("false|yes");
}
}