コード例 #1
0
 public void emit_events_writes_single_state_updated_event()
 {
     var eventWriter = new FakeEventWriter();
     _updateManager.EmitEvents(eventWriter);
     Assert.AreEqual(1, eventWriter.Writes.Count);
     Assert.AreEqual(1, eventWriter.Writes[0].Length);
 }
コード例 #2
0
 public void emit_events_writes_event_with_correct_caused_by_tag()
 {
     var eventWriter = new FakeEventWriter();
     _updateManager.EmitEvents(eventWriter);
     EmittedEvent @event = eventWriter.Writes[0][0];
     Assert.AreEqual(_two, @event.CausedByTag);
 }
コード例 #3
0
 public void emit_events_writes_correct_state_data()
 {
     var eventWriter = new FakeEventWriter();
     _updateManager.EmitEvents(eventWriter);
     EmittedEvent @event = eventWriter.Writes[0][0];
     Assert.AreEqual("[{\"state\":2}]", @event.Data);
 }
コード例 #4
0
        public void emit_events_writes_both_state_updated_event()
        {
            var eventWriter = new FakeEventWriter();

            _updateManager.EmitEvents(eventWriter);
            Assert.AreEqual(2, (eventWriter.Writes.SelectMany(write => write)).Count());
        }
コード例 #5
0
 public void emit_events_writes_event_with_correct_expected_tag()
 {
     var eventWriter = new FakeEventWriter();
     _updateManager.EmitEvents(eventWriter);
     EmittedEvent @event = eventWriter.Writes[0][0];
     Assert.AreEqual(_zero, @event.ExpectedTag);
 }
コード例 #6
0
 public void emit_events_writes_correct_state_data()
 {
     var eventWriter = new FakeEventWriter();
     _updateManager.EmitEvents(eventWriter);
     EmittedEvent @event = eventWriter.Writes[0][0];
     Assert.AreEqual("state2", Encoding.UTF8.GetString(@event.Data));
 }
コード例 #7
0
        public void emit_events_writes_single_state_updated_event()
        {
            var eventWriter = new FakeEventWriter();

            _updateManager.EmitEvents(eventWriter);
            Assert.AreEqual(1, eventWriter.Writes.Count);
            Assert.AreEqual(1, eventWriter.Writes[0].Length);
        }
コード例 #8
0
 public void emit_events_writes_to_correct_streams()
 {
     var eventWriter = new FakeEventWriter();
     _updateManager.EmitEvents(eventWriter);
     var events = eventWriter.Writes.SelectMany(write => write).ToArray();
     Assert.IsTrue(events.Any((v => "$projections-projection-partition1-checkpoint" == v.StreamId)));
     Assert.IsTrue(events.Any((v => "$projections-projection-partition2-checkpoint" == v.StreamId)));
 }
コード例 #9
0
        public void emit_events_writes_event_with_correct_expected_tag()
        {
            var eventWriter = new FakeEventWriter();

            _updateManager.EmitEvents(eventWriter);
            EmittedEvent @event = eventWriter.Writes[0][0];

            Assert.AreEqual(_zero, @event.ExpectedTag);
        }
コード例 #10
0
        public void emit_events_writes_correct_state_data()
        {
            var eventWriter = new FakeEventWriter();

            _updateManager.EmitEvents(eventWriter);
            EmittedEvent @event = eventWriter.Writes[0][0];

            Assert.AreEqual("[{\"state\":2}]", @event.Data);
        }
コード例 #11
0
        public void emit_events_writes_event_with_correct_caused_by_tag()
        {
            var eventWriter = new FakeEventWriter();

            _updateManager.EmitEvents(eventWriter);
            EmittedEvent @event = eventWriter.Writes[0][0];

            Assert.AreEqual(_two, @event.CausedByTag);
        }
コード例 #12
0
 public void emit_events_writes_event_with_correct_expected_tag()
 {
     var eventWriter = new FakeEventWriter();
     _updateManager.EmitEvents(eventWriter);
     var events = eventWriter.Writes.SelectMany(write => write).ToArray();
     var event1 = events.Single(v => "$projections-projection-partition1-checkpoint" == v.StreamId);
     var event2 = events.Single(v => "$projections-projection-partition2-checkpoint" == v.StreamId);
     Assert.AreEqual(_zero, event1.ExpectedTag);
     Assert.AreEqual(_zero, event2.ExpectedTag);
 }
コード例 #13
0
        public void emit_events_writes_to_correct_streams()
        {
            var eventWriter = new FakeEventWriter();

            _updateManager.EmitEvents(eventWriter);
            var events = eventWriter.Writes.SelectMany(write => write).ToArray();

            Assert.IsTrue(events.Any((v => "$projections-projection-partition1-checkpoint" == v.StreamId)));
            Assert.IsTrue(events.Any((v => "$projections-projection-partition2-checkpoint" == v.StreamId)));
        }
コード例 #14
0
        public void emit_events_writes_correct_state_data()
        {
            var eventWriter = new FakeEventWriter();
            _updateManager.EmitEvents(eventWriter);
            var events = eventWriter.Writes.SelectMany(write => write).ToArray();
            var event1 = events.Single(v => "$projections-projection-partition1-checkpoint" == v.StreamId);
            var event2 = events.Single(v => "$projections-projection-partition2-checkpoint" == v.StreamId);

            Assert.AreEqual("[{\"state\":1}]", event1.Data);
            Assert.AreEqual("[{\"state\":2}]", event2.Data);
        }
コード例 #15
0
        public void emit_events_writes_correct_state_data()
        {
            var eventWriter = new FakeEventWriter();

            _updateManager.EmitEvents(eventWriter);
            var events = eventWriter.Writes.SelectMany(write => write).ToArray();
            var event1 = events.Single(v => "$projections-projection-partition1-checkpoint" == v.StreamId);
            var event2 = events.Single(v => "$projections-projection-partition2-checkpoint" == v.StreamId);

            Assert.AreEqual("[{\"state\":1}]", event1.Data);
            Assert.AreEqual("[{\"state\":2}]", event2.Data);
        }
コード例 #16
0
        public void emit_events_writes_event_with_correct_expected_tag()
        {
            var eventWriter = new FakeEventWriter();

            _updateManager.EmitEvents(eventWriter);
            var events = eventWriter.Writes.SelectMany(write => write).ToArray();
            var event1 = events.Single(v => "$projections-projection-partition1-checkpoint" == v.StreamId);
            var event2 = events.Single(v => "$projections-projection-partition2-checkpoint" == v.StreamId);

            Assert.AreEqual(_zero, event1.ExpectedTag);
            Assert.AreEqual(_zero, event2.ExpectedTag);
        }
コード例 #17
0
 public void emit_events_writes_both_state_updated_event()
 {
     var eventWriter = new FakeEventWriter();
     _updateManager.EmitEvents(eventWriter);
     Assert.AreEqual(2, (eventWriter.Writes.SelectMany(write => write)).Count());
 }