コード例 #1
0
        public void BatchWriterStage_must_write_batches_sequentially()
        {
            var b1 = new[] { "a", "b", "c" }.Select(p => new DurableEvent(p)).ToImmutableArray();
            var b2 = new[] { "d", "e", "f" }.Select(p => new DurableEvent(p)).ToImmutableArray();
            var b3 = new[] { "g", "h", "i" }.Select(p => new DurableEvent(p)).ToImmutableArray();

            snk.Request(3);
            src.SendNext(b1);
            src.SendNext(b2);
            src.SendNext(b3);
            snk.ExpectNext().Should().BeEquivalentTo(b1);
            snk.ExpectNext().Should().BeEquivalentTo(b2);
            snk.ExpectNext().Should().BeEquivalentTo(b3);
        }
コード例 #2
0
        public async Task Websocket_connection_should_be_able_to_send_data()
        {
            // Arrange
            var tcs = new TaskCompletionSource <object>();

            await ConnectAsync(msg => tcs.SetResult(msg));

            // Act
            _toClient.SendNext(Signals.Broadcast("payload"));

            // Assert
            var result = await tcs.Task;

            result.Should().Be("payload");
        }