refactor: extract NATS.Server.JetStream.Tests project
Move 225 JetStream-related test files from NATS.Server.Tests into a dedicated NATS.Server.JetStream.Tests project. This includes root-level JetStream*.cs files, storage test files (FileStore, MemStore, StreamStoreContract), and the full JetStream/ subfolder tree (Api, Cluster, Consumers, MirrorSource, Snapshots, Storage, Streams). Updated all namespaces, added InternalsVisibleTo, registered in the solution file, and added the JETSTREAM_INTEGRATION_MATRIX define.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using NATS.Server.JetStream.Models;
|
||||
using NATS.Server.JetStream.Publish;
|
||||
using NATS.Server.JetStream.Validation;
|
||||
|
||||
namespace NATS.Server.JetStream.Tests;
|
||||
|
||||
public class JetStreamStreamRuntimeParityTests
|
||||
{
|
||||
[Fact]
|
||||
public void Stream_runtime_enforces_retention_and_size_preconditions()
|
||||
{
|
||||
var invalid = new StreamConfig
|
||||
{
|
||||
Name = "ORDERS",
|
||||
Subjects = ["orders.*"],
|
||||
Retention = RetentionPolicy.WorkQueue,
|
||||
MaxConsumers = 0,
|
||||
MaxMsgSize = -1,
|
||||
};
|
||||
|
||||
var result = JetStreamConfigValidator.Validate(invalid);
|
||||
result.IsValid.ShouldBeFalse();
|
||||
|
||||
var preconditions = new PublishPreconditions();
|
||||
preconditions.Record("m1", 1);
|
||||
preconditions.IsDuplicate("m1", duplicateWindowMs: 10_000, out var existing).ShouldBeTrue();
|
||||
existing.ShouldBe((ulong)1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user