public void a_projection_can_be_subscribed_after_event_position() { var subscribed = _point.TrySubscribe( Guid.NewGuid(), new FakeProjectionSubscription(), CheckpointTag.FromStreamPosition("stream", 100, prepaprePosition: 30)); Assert.AreEqual(true, subscribed); }
public void setup() { _exception = null; try { _point = new HeadingEventDistributionPoint(10); } catch (Exception ex) { _exception = ex; } _distibutionPointCorrelationId = Guid.NewGuid(); _point.Start( _distibutionPointCorrelationId, new TransactionFileReaderEventDistributionPoint( _bus, _distibutionPointCorrelationId, new EventPosition(0, -1))); _point.Handle( new ProjectionCoreServiceMessage.CommittedEventDistributed( _distibutionPointCorrelationId, new EventPosition(20, 10), "stream", 10, false, new Event(Guid.NewGuid(), "type", false, new byte[0], new byte[0]))); _point.Handle( new ProjectionCoreServiceMessage.CommittedEventDistributed( _distibutionPointCorrelationId, new EventPosition(40, 30), "stream", 11, false, new Event(Guid.NewGuid(), "type", false, new byte[0], new byte[0]))); _subscription = new FakeProjectionSubscription(); _projectionSubscriptionId = Guid.NewGuid(); var subscribed = _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30); Assert.IsTrue(subscribed); // ensure we really unsubscribing.. even if it is tested elsewhere _point.Unsubscribe(_projectionSubscriptionId); }
public void cannot_suibscribe_even_from_reader_zero_position() { var subscribed = _point.TrySubscribe( Guid.NewGuid(), new FakeProjectionSubscription(), CheckpointTag.FromPosition(0, -1)); Assert.AreEqual(false, subscribed); }
public void setup() { _exception = null; try { _point = new HeadingEventDistributionPoint(10); } catch (Exception ex) { _exception = ex; } _distibutionPointCorrelationId = Guid.NewGuid(); _point.Start( _distibutionPointCorrelationId, new TransactionFileReaderEventDistributionPoint( _bus, _distibutionPointCorrelationId, new EventPosition(0, -1))); _point.Handle( new ProjectionMessage.Projections.CommittedEventDistributed( _distibutionPointCorrelationId, new EventPosition(20, 10), "stream", 10, false, new Event(Guid.NewGuid(), "type", false, new byte[0], new byte[0]))); _point.Handle( new ProjectionMessage.Projections.CommittedEventDistributed( _distibutionPointCorrelationId, new EventPosition(40, 30), "stream", 11, false, new Event(Guid.NewGuid(), "type", false, new byte[0], new byte[0]))); _subscription = new FakeProjectionSubscription(); _projectionSubscriptionId = Guid.NewGuid(); var subscribed = _point.TrySubscribe( _projectionSubscriptionId, _subscription, CheckpointTag.FromStreamPosition("stream", 100, prepaprePosition: 30)); }
public void projection_can_resubscribe_with() { var subscribed = _point.TrySubscribe( _projectionSubscriptionId, _subscription, CheckpointTag.FromStreamPosition("stream", 100, prepaprePosition: 30)); Assert.AreEqual(true, subscribed); }
public void projection_can_resubscribe_with() { var subscribed = _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30); Assert.AreEqual(true, subscribed); }
public void no_other_projection_can_subscribe_with_the_same_projection_id() { var subscribed = _point.TrySubscribe(_projectionSubscriptionId, _subscription, 30); }
public void a_projection_can_be_subscribed_after_event_position() { var subscribed = _point.TrySubscribe(Guid.NewGuid(), new FakeProjectionSubscription(), 30); Assert.AreEqual(true, subscribed); }
public void no_other_projection_can_subscribe_with_the_same_projection_id() { var subscribed = _point.TrySubscribe( _projectionSubscriptionId, _subscription, CheckpointTag.FromStreamPosition("stream", 100, prepaprePosition: 30)); }
public void try_subscribe_throws_invalid_operation_exception() { _point.TrySubscribe(Guid.NewGuid(), new FakeProjectionSubscription(), CheckpointTag.FromPosition(20, 10)); }
public void try_subscribe_throws_invalid_operation_exception() { _point.TrySubscribe(Guid.NewGuid(), new FakeProjectionSubscription(), 10); }