本文整理汇总了C#中EventStore.Core.Tests.Fakes.FakePublisher类的典型用法代码示例。如果您正苦于以下问题:C# FakePublisher类的具体用法?C# FakePublisher怎么用?C# FakePublisher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FakePublisher类属于EventStore.Core.Tests.Fakes命名空间,在下文中一共展示了FakePublisher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setup
public void setup()
{
_publisher = new FakePublisher();
_manager = new ProjectionManager(_publisher, checkpointForStatistics: null);
_manager.Handle(new ProjectionManagementMessage.Post(new PublishEnvelope(_publisher), @"log(1);", enabled: true));
}
示例2: setup
public void setup()
{
_publisher = new FakePublisher();
_readyHandler = new TestMessageHandler<ProjectionMessage.Projections.ReadyForCheckpoint>();
_stream = new EmittedStream("test", _publisher, _readyHandler, false, 50);
_stream.Start();
}
示例3: setup
public void setup()
{
_publisher = new FakePublisher();
_readyHandler = new TestCheckpointManagerMessageHandler();;
_stream = new EmittedStream("test", CheckpointTag.FromPosition(0, -1), _publisher, _readyHandler, 50);
_stream.Start();
}
示例4: Setup
public void Setup()
{
var fakePublisher = new FakePublisher();
_ioDispatcher = new IODispatcher(fakePublisher, new PublishEnvelope(fakePublisher));
_subscriptionDispatcher =
new ReaderSubscriptionDispatcher(new FakePublisher());
}
示例5: setup
public void setup()
{
_publisher = new FakePublisher();
_readyHandler = new TestMessageHandler<ProjectionMessage.Projections.ReadyForCheckpoint>();
_stream = new EmittedStream("test", _publisher, _readyHandler, false, 50);
_stream.EmitEvents(
new[] {new EmittedEvent("stream", Guid.NewGuid(), "type", "data")}, CheckpointTag.FromPosition(200, 150));
}
示例6: setup
public void setup()
{
_publisher = new FakePublisher();
_manager = new ProjectionManager(_publisher, checkpointForStatistics: null);
_projectionQuery = @"fromAll(); on_any(function(){});log(1);";
_manager.Handle(new ProjectionManagementMessage.Post(new PublishEnvelope(_publisher), _projectionQuery, enabled: true));
_projectionName = _publisher.Messages.OfType<ProjectionManagementMessage.Updated>().Single().Name;
}
示例7: setup
public void setup()
{
_publisher = new FakePublisher();
_readyHandler = new TestMessageHandler<ProjectionMessage.Projections.ReadyForCheckpoint>();
_stream = new EmittedStream("test", _publisher, _readyHandler, false, 50);
_stream.Start();
_stream.EmitEvents(
new[] {new EmittedEvent("stream", Guid.NewGuid(), "type", "data")}, CheckpointTag.FromPosition(-1, -1));
var msg = _publisher.Messages.OfType<ClientMessage.WriteEvents>().First();
_stream.Handle(new ClientMessage.WriteEventsCompleted(msg.CorrelationId, msg.EventStreamId, 0));
_stream.Checkpoint();
}
开发者ID:jpierson,项目名称:EventStore,代码行数:12,代码来源:when_checkpoint_requested_with_all_writes_already_completed.cs
示例8: setup
public void setup()
{
_fakePublisher = new FakePublisher();
_readDispatcher =
new RequestResponseDispatcher
<ClientMessage.ReadStreamEventsBackward, ClientMessage.ReadStreamEventsBackwardCompleted>(
_fakePublisher, v => v.CorrelationId, v => v.CorrelationId, new PublishEnvelope(_fakePublisher));
_writeDispatcher =
new RequestResponseDispatcher<ClientMessage.WriteEvents, ClientMessage.WriteEventsCompleted>(
_fakePublisher, v => v.CorrelationId, v => v.CorrelationId, new PublishEnvelope(_fakePublisher));
;
}
示例9: SetUp
public void SetUp()
{
_bus = new FakePublisher();
_manager = new TwoPhaseCommitRequestManager(_bus, 2, 2);
_correlationID = Guid.NewGuid();
_manager.Handle(new ReplicationMessage.WriteRequestCreated(_correlationID,
new NoopEnvelope(),
"test-stream",
-1,
new Event[0]));
_prepareAck = new ReplicationMessage.PrepareAck(_correlationID, 0, PrepareFlags.TransactionBegin | PrepareFlags.TransactionEnd);
_commitAck = new ReplicationMessage.CommitAck(_correlationID, 0, 0);
}
示例10: Setup
public void Setup()
{
Publisher = new FakePublisher();
Envelope = new FakeEnvelope();
Manager = OnManager(Publisher);
foreach(var m in WithInitialMessages())
{
Manager.AsDynamic().Handle(m);
}
Publisher.Messages.Clear();
Manager.AsDynamic().Handle(When());
Produced = new List<Message>(Publisher.Messages);
}
示例11: setup
public void setup()
{
_publisher = new FakePublisher();
_readyHandler = new TestMessageHandler<ProjectionMessage.Projections.ReadyForCheckpoint>();
_stream = new EmittedStream("test", _publisher, _readyHandler, false, 50);
try
{
_stream.Checkpoint();
}
catch (Exception ex)
{
_caughtException = ex;
}
}
示例12: setup
public void setup()
{
_timeProvider = new FakeTimeProvider();
_queues = new Dictionary<Guid, IPublisher> {{Guid.NewGuid(), new FakePublisher()}};
_timeoutSchedulers = ProjectionCoreWorkersNode.CreateTimeoutSchedulers(_queues.Count);
var fakePublisher = new FakePublisher();
new ProjectionCoreCoordinator(
ProjectionType.All,
_timeoutSchedulers,
_queues.Values.ToArray(),
fakePublisher,
new NoopEnvelope());
_ioDispatcher = new IODispatcher(fakePublisher, new PublishEnvelope(fakePublisher));
}
示例13: setup
public void setup()
{
_publisher = new FakePublisher();
_readyHandler = new TestCheckpointManagerMessageHandler();;
_stream = new EmittedStream("test", CheckpointTag.FromPosition(0, -1), _publisher, _readyHandler, 50);
try
{
_stream.Checkpoint();
}
catch (Exception ex)
{
_caughtException = ex;
}
}
示例14: setup
public void setup()
{
_checkpointUnhandledBytesThreshold = 1000;
Given();
_bus = new FakePublisher();
_projectionCorrelationId = Guid.NewGuid();
_eventHandler = new TestMessageHandler<ProjectionMessage.Projections.CommittedEventReceived>();
_checkpointHandler = new TestMessageHandler<ProjectionMessage.Projections.CheckpointSuggested>();
_subscription = new ProjectionSubscription(
_projectionCorrelationId, CheckpointTag.FromPosition(0, -1), _eventHandler, _checkpointHandler,
CreateCheckpointStrategy(), _checkpointUnhandledBytesThreshold);
When();
}
示例15: setup
public void setup()
{
_checkpointUnhandledBytesThreshold = 1000;
Given();
_bus = new FakePublisher();
_projectionCorrelationId = Guid.NewGuid();
_eventHandler = new TestHandler<ProjectionSubscriptionMessage.CommittedEventReceived>();
_checkpointHandler = new TestHandler<ProjectionSubscriptionMessage.CheckpointSuggested>();
_progressHandler = new TestHandler<ProjectionSubscriptionMessage.ProgressChanged>();
_eofHandler = new TestHandler<ProjectionSubscriptionMessage.EofReached>();
_checkpointStrategy = CreateCheckpointStrategy();
_subscription = CreateProjectionSubscription();
When();
}