test(batch19): port accounts core mapped tests
This commit is contained in:
@@ -246,6 +246,62 @@ public sealed class AccountTests
|
||||
system.CheckServiceExportApproved(global, "$SYS.REQ.INFO", null).ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact] // T:81
|
||||
public void MultipleStreamImportsWithSameSubjectDifferentPrefix_ShouldSucceed()
|
||||
{
|
||||
var fooAccount = Account.NewAccount("foo");
|
||||
var barAccount = Account.NewAccount("bar");
|
||||
var importAccount = Account.NewAccount("import");
|
||||
|
||||
fooAccount.AddStreamExport("test", null).ShouldBeNull();
|
||||
barAccount.AddStreamExport("test", null).ShouldBeNull();
|
||||
|
||||
importAccount.AddStreamImport(fooAccount, "test", "foo").ShouldBeNull();
|
||||
importAccount.AddStreamImport(barAccount, "test", "bar").ShouldBeNull();
|
||||
|
||||
importAccount.Imports.Streams.ShouldNotBeNull();
|
||||
importAccount.Imports.Streams!.Count.ShouldBe(2);
|
||||
importAccount.Imports.Streams.Select(si => si.To).OrderBy(static t => t).ToArray()
|
||||
.ShouldBe(["bar.test", "foo.test"]);
|
||||
}
|
||||
|
||||
[Fact] // T:82
|
||||
public void MultipleStreamImportsWithSameSubject_ShouldSucceed()
|
||||
{
|
||||
var fooAccount = Account.NewAccount("foo");
|
||||
var barAccount = Account.NewAccount("bar");
|
||||
var importAccount = Account.NewAccount("import");
|
||||
|
||||
fooAccount.AddStreamExport("test", null).ShouldBeNull();
|
||||
barAccount.AddStreamExport("test", null).ShouldBeNull();
|
||||
|
||||
importAccount.AddStreamImport(fooAccount, "test", string.Empty).ShouldBeNull();
|
||||
importAccount.AddStreamImport(fooAccount, "test", string.Empty).ShouldBe(ServerErrors.ErrStreamImportDuplicate);
|
||||
importAccount.AddStreamImport(barAccount, "test", string.Empty).ShouldBeNull();
|
||||
|
||||
importAccount.Imports.Streams.ShouldNotBeNull();
|
||||
importAccount.Imports.Streams!.Count.ShouldBe(2);
|
||||
importAccount.Imports.Streams.Select(si => si.Account?.Name).OrderBy(static n => n).ToArray()
|
||||
.ShouldBe(["bar", "foo"]);
|
||||
}
|
||||
|
||||
[Fact] // T:95
|
||||
public void BenchmarkNewRouteReply()
|
||||
{
|
||||
var globalAccount = Account.NewAccount("$G");
|
||||
|
||||
var first = globalAccount.NewServiceReply(tracking: false);
|
||||
var second = globalAccount.NewServiceReply(tracking: false);
|
||||
var tracked = globalAccount.NewServiceReply(tracking: true);
|
||||
|
||||
first.Length.ShouldBeGreaterThan(20);
|
||||
second.Length.ShouldBeGreaterThan(20);
|
||||
first.SequenceEqual(second).ShouldBeFalse();
|
||||
|
||||
var trackedText = Encoding.ASCII.GetString(tracked);
|
||||
trackedText.EndsWith(".T", StringComparison.Ordinal).ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact] // T:98
|
||||
public void ImportSubscriptionPartialOverlapWithPrefix_ShouldSucceed()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user