From f99309ea8f82e1ccf31f0a0c242c949c5c29168d Mon Sep 17 00:00:00 2001 From: Liam Morrow Date: Mon, 25 May 2020 22:22:33 +1000 Subject: [PATCH] Update test --- .../Grains/RewindableMessageGrainTests.cs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test/OrgnalR.Tests/Grains/RewindableMessageGrainTests.cs b/test/OrgnalR.Tests/Grains/RewindableMessageGrainTests.cs index 3c614b4..4e6abec 100644 --- a/test/OrgnalR.Tests/Grains/RewindableMessageGrainTests.cs +++ b/test/OrgnalR.Tests/Grains/RewindableMessageGrainTests.cs @@ -16,15 +16,16 @@ public class RewindableMessageGrainTests : TestKitBase [Fact] public async Task GetMessageSinceReturnsAllMessagesIfInBounds() { - Silo.ServiceProvider.AddService(new OrgnalRSiloConfig - { - MaxMessageRewind = 1 - }); + Silo.ServiceProvider.AddService( + new OrgnalRSiloConfig + { + MaxMessageRewind = 1, + }); var grain = await Silo.CreateGrainAsync>(Guid.NewGuid().ToString()); - var handle = await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new InvocationMessage("TestTarget1", new object[0]))); + var handle = await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new MethodMessage("TestTarget1", new object[0]))); var since = await grain.GetMessagesSinceAsync(handle); Assert.Empty(since); - var secondMsg = new AnonymousMessage(new HashSet(), new InvocationMessage("TestTarget2", new object[0])); + var secondMsg = new AnonymousMessage(new HashSet(), new MethodMessage("TestTarget2", new object[0])); var handle2 = await grain.PushMessageAsync(secondMsg); since = await grain.GetMessagesSinceAsync(handle2); Assert.Empty(since); @@ -44,7 +45,7 @@ public async Task GetMessageSinceReturnsAllMessagesIfInBoundsLargerSet() }); var grain = await Silo.CreateGrainAsync>(Guid.NewGuid().ToString()); var handles = Enumerable.Range(0, 20) - .Select(i => grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new InvocationMessage(i.ToString(), new object[0])))) + .Select(i => grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new MethodMessage(i.ToString(), new object[0])))) .Select(x => x.Result) .ToList(); @@ -75,9 +76,9 @@ public async Task GetMessageSinceThrowsWhenOutOfBounds() MaxMessageRewind = 1 }); var grain = await Silo.CreateGrainAsync>(Guid.NewGuid().ToString()); - var handle = await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new InvocationMessage("TestTarget1", new object[0]))); - await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new InvocationMessage("TestTarget2", new object[0]))); - await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new InvocationMessage("TestTarget3", new object[0]))); + var handle = await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new MethodMessage("TestTarget1", new object[0]))); + await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new MethodMessage("TestTarget2", new object[0]))); + await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new MethodMessage("TestTarget3", new object[0]))); await Assert.ThrowsAsync(async () => { await grain.GetMessagesSinceAsync(handle); @@ -92,7 +93,7 @@ public async Task GetMessageSinceReturnsEmptyWhenGroupChanges() MaxMessageRewind = 1 }); var grain = await Silo.CreateGrainAsync>(Guid.NewGuid().ToString()); - var handle = await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new InvocationMessage("TestTarget1", new object[0]))); + var handle = await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new MethodMessage("TestTarget1", new object[0]))); handle = new MessageHandle(handle.MessageId, Guid.NewGuid()); Assert.Empty(await grain.GetMessagesSinceAsync(handle)); } @@ -105,7 +106,7 @@ public async Task GetMessageSinceReturnsEmptyWhenHandleNewer() MaxMessageRewind = 1 }); var grain = await Silo.CreateGrainAsync>(Guid.NewGuid().ToString()); - var handle = await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new InvocationMessage("TestTarget1", new object[0]))); + var handle = await grain.PushMessageAsync(new AnonymousMessage(new HashSet(), new MethodMessage("TestTarget1", new object[0]))); handle = new MessageHandle(handle.MessageId + 1, handle.MessageGroup); Assert.Empty(await grain.GetMessagesSinceAsync(handle)); }