batch36 task5-6 group-d-e and test waves t3-t4

This commit is contained in:
Joseph Doherty
2026-02-28 23:20:30 -05:00
parent 856cd17554
commit f38c0e6b6e
11 changed files with 1030 additions and 6 deletions

View File

@@ -0,0 +1,36 @@
using Shouldly;
using ZB.MOM.NatsNet.Server;
namespace ZB.MOM.NatsNet.Server.Tests.JetStream;
public partial class StorageEngineTests
{
[Fact] // T:2952
public void StoreStreamInteriorDeleteAccounting_ShouldSucceed()
{
var fs = NewMemStore(new StreamConfig
{
Name = "ACC",
Subjects = ["acc"],
});
for (var i = 0; i < 10; i++)
fs.StoreMsg("acc", null, null, 0);
var (removed, err) = fs.RemoveMsg(5);
removed.ShouldBeTrue();
err.ShouldBeNull();
var state = fs.State();
state.Msgs.ShouldBe(9UL);
state.FirstSeq.ShouldBe(1UL);
state.LastSeq.ShouldBe(10UL);
state.NumDeleted.ShouldBe(1);
var (next, seq) = fs.LoadNextMsg("acc", false, 5, new StoreMsg());
next.ShouldNotBeNull();
seq.ShouldBe(6UL);
fs.Stop();
}
}