Path: redb-route/tests/redb.Route.Tests/Expressions/DottedPropertyNameTests.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/Expressions/DottedPropertyNameTests.cs
----
using AwesomeAssertions;
using redb.Route.Abstractions;
using redb.Route.Core;
using redb.Route.Expressions;
namespace redb.Route.Tests.Expressions;
///
/// A property whose name contains a dot (omni.PollInterval, the shape a module uses to
/// namespace its settings). Reported 2026-09-24: written bare — property.omni.PollInterval in
/// a delay or a setProperty — it read as empty, while the same name inside
/// ${...}, in a comparison, and any dotted header resolved fine. The bare value path
/// went straight to nested access, so it looked for a property named omni and a member
/// PollInterval on it; every other path asks for the literal name first.
///
[Collection("ExpressionResolver")]
public class DottedPropertyNameTests : IDisposable
{
public DottedPropertyNameTests() => ExpressionResolver.ClearAllCaches();
public void Dispose()
{
ExpressionResolver.ClearAllCaches();
GC.SuppressFinalize(this);
}
private static IExchange WithProperty(string name, object? value)
{
var exchange = new Exchange(new Message("body"));
exchange.Properties[name] = value;
return exchange;
}
private sealed class Settings
{
public int PollInterval { get; set; }
}
[Fact]
public void A_bare_expression_reads_a_property_whose_name_holds_a_dot()
{
var exchange = WithProperty("omni.PollInterval", 5000);
new StringExpression("property.omni.PollInterval").Evaluate