Path: redb-route/tests/redb.Route.Tests/Expressions/DottedPathArgumentTests.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/DottedPathArgumentTests.cs
----
using AwesomeAssertions;
using redb.Route.Core;
using redb.Route.Expressions;
namespace redb.Route.Tests.Expressions;
///
/// A dotted path splits at its separators only (findings register row 33): a dot inside a method's parentheses, in a
/// quoted argument or in square brackets belongs to the argument, so list.contains(5.0) is one method call.
///
public sealed class DottedPathArgumentTests
{
private static Exchange Message()
{
var exchange = new Exchange(new Message("x"));
exchange.In.Headers["ints"] = new List { 3 };
exchange.In.Headers["doubles"] = new List { 2.5 };
exchange.In.Headers["names"] = new List { "a.b" };
exchange.In.Headers["s"] = "x.a.b";
return exchange;
}
[Theory]
[InlineData("${header.ints.contains(3.0)}", true)]
[InlineData("${header.ints.contains(5.0)}", false)]
[InlineData("${header.doubles.contains(2.5)}", true)]
[InlineData("${header.doubles.contains(7.5)}", false)]
[InlineData("${header.names.contains('a.b')}", true)]
[InlineData("${header.names.contains('a.c')}", false)]
[InlineData("${header.s.contains('a.b')}", true)]
[InlineData("${header.s.contains(\"a.c\")}", false)]
public void AMethodArgument_KeepsItsDots(string template, bool expected)
{
new StringExpression(template).Evaluate