public static QueryExpectation <TQuery> ExpectQuery <TQuery>( this ActorRefMock mock, Expression <Func <TQuery, bool> > match = null) where TQuery : Query { return(mock.ExpectAsk(match)); }
public static CommandExpectation <TCommand> ExpectCommand <TCommand>( this ActorRefMock mock, Expression <Func <TCommand, bool> > match = null) where TCommand : Command { return(mock.ExpectTell(match)); }
public void An_ActorRef_Mock_should_be_like_Nobody() { var mock = new ActorRefMock(); mock.Tell("dummy"); mock.IsNobody().ShouldBeTrue(); }
public override void SetUp() { base.SetUp(); facebook = System.MockActorOf <Api>("facebook"); twitter = System.MockActorOf <Api>("twitter"); schedule = new Dictionary <ActorRef, TimeSpan> { { facebook, TimeSpan.FromMinutes(10) }, { twitter, TimeSpan.FromMinutes(5) }, }; topic = new Topic("42", Runtime, new TopicStorageMock()); }
public override void SetUp() { base.SetUp(); facebook = System.MockActorOf<Api>("facebook"); twitter = System.MockActorOf<Api>("twitter"); schedule = new Dictionary<ActorRef, TimeSpan> { {facebook, TimeSpan.FromMinutes(10)}, {twitter, TimeSpan.FromMinutes(5)}, }; topic = new Topic("42", Runtime, new TopicStorageMock()); }
public void SetUp() { actor = new ActorRefMock(ActorPath.From(typeof(TestActor), Guid.NewGuid().ToString("D"))); }
public ActorRef ActorOf(ActorPath path) { return(RequestedRef = new ActorRefMock(path)); }
public static TQuery FirstQuery <TQuery>(this ActorRefMock mock) { return(mock.Queries().OfType <TQuery>().FirstOrDefault()); }
public static TCommand FirstCommand <TCommand>(this ActorRefMock mock) { return(mock.Commands().OfType <TCommand>().FirstOrDefault()); }
public static bool DidNotReceiveAnyQueries(this ActorRefMock mock) { return(!mock.Queries().Any()); }
public static bool DidNotReceiveAnyCommands(this ActorRefMock mock) { return(!mock.Commands().Any()); }
public static IEnumerable <Query> Queries(this ActorRefMock mock) { return(mock.Received.Select(x => x.Message).Cast <Query>()); }
public static IEnumerable <Command> Commands(this ActorRefMock mock) { return(mock.Received.Select(x => x.Message).Cast <Command>()); }
public static void Reset(this ActorRefMock mock) { mock.Received.Clear(); }
public static void Reset(this ActorRefMock mock) { mock.RecordedCommands.Clear(); mock.RecordedQueries.Clear(); }
public ActorRef ActorOf(ActorPath path) { return (RequestedRef = new ActorRefMock(path)); }