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); }
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); }
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); }
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()); }
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); }
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)); }
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); }
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))); }
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); }
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); }
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); }
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); }
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))); }
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); }
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); }
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); }
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()); }