public void Setup() { _graphBuilder = new EventGraphBuilder(); var graph = _graphBuilder.WaitForSignalEvent(ScheduleId.Raw("id"), 10, new [] { "e1", "e2" }, SignalWaitType.Any); _event = new WaitForSignalsEvent(graph, Enumerable.Empty <HistoryEvent>()); }
public void Keep_waiting_when_resumed_signal_is_for_differnt_trigger_event_id() { var w = _graphBuilder.WaitForSignalEvent(ScheduleId.Raw("id"), 10, new[] { "e1", "e2" }, SignalWaitType.Any); var r = _graphBuilder.WorkflowItemSignalledEvent(ScheduleId.Raw("id"), 11, "e2"); var @event = new WaitForSignalsEvent(w, new[] { r, w }); Assert.That(@event.WaitingSignals, Is.EqualTo(new[] { "e1", "e2" })); Assert.That(@event.IsExpectingSignals, Is.True); }
public void No_more_waits_when_second_signal_is_received() { var w = _graphBuilder.WaitForSignalEvent(ScheduleId.Raw("id"), 10, new[] { "e1", "e2" }, SignalWaitType.Any); var r = _graphBuilder.WorkflowItemSignalledEvent(ScheduleId.Raw("id"), 10, "e2"); var @event = new WaitForSignalsEvent(w, new[] { r, w }); Assert.That(@event.WaitingSignals, Is.Empty); Assert.That(@event.IsExpectingSignals, Is.False); }
public void Keeps_waiting_when_second_signal_is_received() { var w = _graphBuilder.WaitForSignalEvent(ScheduleId.Raw("id"), 10, new[] { "e1", "e2" }, SignalWaitType.All); var r = _graphBuilder.WorkflowItemSignalledEvent(ScheduleId.Raw("id"), 10, "e2"); var @event = new WaitForSignalsEvent(w, new[] { r, w }); Assert.That(@event.WaitingSignals, Is.EqualTo(new[] { "e1" })); Assert.That(@event.IsExpectingSignals, Is.True); }
public void Equality_test() { Assert.That(ScheduleId.Create("name", "ver", "pos").Equals(ScheduleId.Create("name", "ver", "pos"))); Assert.That(ScheduleId.Create("name", "ver", "").Equals(ScheduleId.Create("name", "ver", ""))); Assert.That(ScheduleId.Raw("identity").Equals(ScheduleId.Raw("identity"))); Assert.That(ScheduleId.Create("name", "ver", "pos") == ScheduleId.Create("name", "ver", "pos")); Assert.That(ScheduleId.Create("name", "ver", "") == ScheduleId.Create("name", "ver", "")); Assert.That(ScheduleId.Raw("identity") == ScheduleId.Raw("identity")); Assert.False(ScheduleId.Create("name", "ver", "pos").Equals(ScheduleId.Create("name", "ver", "pos1"))); Assert.False(ScheduleId.Create("name", "ver", "pos").Equals(ScheduleId.Create("name", "ver1", "pos"))); Assert.False(ScheduleId.Create("name", "ver", "pos").Equals(ScheduleId.Create("name1", "ver", "pos"))); Assert.False(ScheduleId.Raw("identity").Equals(ScheduleId.Raw("identity1"))); Assert.True(ScheduleId.Create("name", "ver", "pos") != ScheduleId.Create("name", "ver", "pos1")); Assert.True(ScheduleId.Create("name", "ver", "pos") != ScheduleId.Create("name", "ver1", "pos")); Assert.True(ScheduleId.Create("name", "ver", "pos") != ScheduleId.Create("name1", "ver", "pos")); }
public void Setup() { _graphBuilder = new EventGraphBuilder(); _event = new WorkflowItemSignalledEvent(_graphBuilder.WorkflowItemSignalledEvent(ScheduleId.Raw("id"), 10, "e1")); }