Files
natsdotnet/tests/NATS.Server.Tests/Events/EventServerInfoCapabilityParityBatch1Tests.cs
Joseph Doherty c30e67a69d Fix E2E test gaps and add comprehensive E2E + parity test suites
- Fix pull consumer fetch: send original stream subject in HMSG (not inbox)
  so NATS client distinguishes data messages from control messages
- Fix MaxAge expiry: add background timer in StreamManager for periodic pruning
- Fix JetStream wire format: Go-compatible anonymous objects with string enums,
  proper offset-based pagination for stream/consumer list APIs
- Add 42 E2E black-box tests (core messaging, auth, TLS, accounts, JetStream)
- Add ~1000 parity tests across all subsystems (gaps closure)
- Update gap inventory docs to reflect implementation status
2026-03-12 14:09:23 -04:00

47 lines
1.3 KiB
C#

using System.Text.Json;
using NATS.Server.Events;
namespace NATS.Server.Tests.Events;
public class EventServerInfoCapabilityParityBatch1Tests
{
[Fact]
public void ServerCapability_flags_match_expected_values()
{
((ulong)ServerCapability.JetStreamEnabled).ShouldBe(1UL << 0);
((ulong)ServerCapability.BinaryStreamSnapshot).ShouldBe(1UL << 1);
((ulong)ServerCapability.AccountNRG).ShouldBe(1UL << 2);
}
[Fact]
public void EventServerInfo_capability_methods_set_and_read_flags()
{
var info = new EventServerInfo();
info.SetJetStreamEnabled();
info.SetBinaryStreamSnapshot();
info.SetAccountNRG();
info.JetStream.ShouldBeTrue();
info.JetStreamEnabled().ShouldBeTrue();
info.BinaryStreamSnapshot().ShouldBeTrue();
info.AccountNRG().ShouldBeTrue();
}
[Fact]
public void ServerID_serializes_with_name_host_id_fields()
{
var payload = new ServerID
{
Name = "srv-a",
Host = "127.0.0.1",
Id = "N1",
};
var json = JsonSerializer.Serialize(payload);
json.ShouldContain("\"name\":\"srv-a\"");
json.ShouldContain("\"host\":\"127.0.0.1\"");
json.ShouldContain("\"id\":\"N1\"");
}
}