Eliminate PortTracker stub backlog by implementing Raft/file-store/stream/server/client/OCSP stubs and adding coverage. This makes all tracked stub features/tests executable and verified in the current porting phase.

This commit is contained in:
Joseph Doherty
2026-02-27 08:56:26 -05:00
parent ba4f41cf71
commit 8849265780
33 changed files with 2938 additions and 407 deletions

View File

@@ -0,0 +1,39 @@
// Copyright 2012-2026 The NATS Authors
// Licensed under the Apache License, Version 2.0
using Shouldly;
using ZB.MOM.NatsNet.Server;
namespace ZB.MOM.NatsNet.Server.Tests.JetStream;
public sealed class CompressionInfoTests
{
[Fact]
public void MarshalMetadata_UnmarshalMetadata_ShouldRoundTrip()
{
var ci = new CompressionInfo
{
Type = StoreCompression.S2Compression,
Original = 12345,
Compressed = 6789,
};
var payload = ci.MarshalMetadata();
payload.Length.ShouldBeGreaterThan(4);
var copy = new CompressionInfo();
var consumed = copy.UnmarshalMetadata(payload);
consumed.ShouldBe(payload.Length);
copy.Type.ShouldBe(StoreCompression.S2Compression);
copy.Original.ShouldBe(12345UL);
copy.Compressed.ShouldBe(6789UL);
}
[Fact]
public void UnmarshalMetadata_InvalidPrefix_ShouldReturnZero()
{
var ci = new CompressionInfo();
ci.UnmarshalMetadata([1, 2, 3, 4]).ShouldBe(0);
}
}