Exemple #1
0
 public static QueryExpectation <TQuery> ExpectQuery <TQuery>(
     this ActorRefMock mock,
     Expression <Func <TQuery, bool> > match = null)
     where TQuery : Query
 {
     return(mock.ExpectAsk(match));
 }
Exemple #2
0
 public static CommandExpectation <TCommand> ExpectCommand <TCommand>(
     this ActorRefMock mock,
     Expression <Func <TCommand, bool> > match = null)
     where TCommand : Command
 {
     return(mock.ExpectTell(match));
 }
Exemple #3
0
        public void An_ActorRef_Mock_should_be_like_Nobody()
        {
            var mock = new ActorRefMock();

            mock.Tell("dummy");

            mock.IsNobody().ShouldBeTrue();
        }
Exemple #4
0
        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());
        }
Exemple #5
0
        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")));
 }
Exemple #7
0
 public ActorRef ActorOf(ActorPath path)
 {
     return(RequestedRef = new ActorRefMock(path));
 }
Exemple #8
0
 public static TQuery FirstQuery <TQuery>(this ActorRefMock mock)
 {
     return(mock.Queries().OfType <TQuery>().FirstOrDefault());
 }
Exemple #9
0
 public static TCommand FirstCommand <TCommand>(this ActorRefMock mock)
 {
     return(mock.Commands().OfType <TCommand>().FirstOrDefault());
 }
Exemple #10
0
 public static bool DidNotReceiveAnyQueries(this ActorRefMock mock)
 {
     return(!mock.Queries().Any());
 }
Exemple #11
0
 public static bool DidNotReceiveAnyCommands(this ActorRefMock mock)
 {
     return(!mock.Commands().Any());
 }
Exemple #12
0
 public static IEnumerable <Query> Queries(this ActorRefMock mock)
 {
     return(mock.Received.Select(x => x.Message).Cast <Query>());
 }
Exemple #13
0
 public static IEnumerable <Command> Commands(this ActorRefMock mock)
 {
     return(mock.Received.Select(x => x.Message).Cast <Command>());
 }
Exemple #14
0
 public static void Reset(this ActorRefMock mock)
 {
     mock.Received.Clear();
 }
Exemple #15
0
 public static void Reset(this ActorRefMock mock)
 {
     mock.RecordedCommands.Clear();
     mock.RecordedQueries.Clear();
 }
 public ActorRef ActorOf(ActorPath path)
 {
     return (RequestedRef = new ActorRefMock(path));
 }