Path: redb-route/tests/redb.Route.Tests/Core/ListBodyTests.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/Core/ListBodyTests.cs
----
using System.Text.Json.Nodes;
using AwesomeAssertions;
using redb.Route.Abstractions;
using redb.Route.Core;
namespace redb.Route.Tests.Core;
/// A list body at a producer: what is a list of messages, what is a plain list, and the exchange of one element.
public class ListBodyTests
{
[Fact]
public void A_list_of_messages_is_recognised()
{
var body = new List { new Message("a"), new Message("b") };
ListBody.Messages(body).Should().HaveCount(2);
ListBody.IsPlainList(body).Should().BeFalse();
}
[Theory]
[MemberData(nameof(PlainLists))]
public void A_collection_without_a_text_form_is_a_plain_list(object body)
=> ListBody.IsPlainList(body).Should().BeTrue();
public static TheoryData