Exemplo n.º 1
0
 protected static void setup_event_stream(params StreamEvent[] streamEvents)
 {
     events_fetcher
     .Setup(_ => _.Fetch(It.IsAny <StreamPosition>(), It.IsAny <CancellationToken>()))
     .Returns <StreamPosition, CancellationToken>((position, ct) =>
     {
         var events = streamEvents.Skip((int)position.Value);
         return(events.Any()
                 ? Task.FromResult(Try <IEnumerable <StreamEvent> > .Succeeded(events))
                 : Task.FromResult(Try <IEnumerable <StreamEvent> > .Failed(new Exception())));
     });
     event_waiter.NotifyForEvent(source_stream_id, (ulong)(streamEvents.Length - 1));
 }
Exemplo n.º 2
0
 protected static void NotFail()
 {
     NotCalled(x => x.Fail(IT.IsAny <string>(), IT.IsAny <object>()));
     NotCalled(x => x.Fail(IT.IsAny <string>()));
 }
Exemplo n.º 3
0
 public static T IsAny <T>()
 {
     return(It.IsAny <T>());
 }