@@ -105,15 +105,15 @@ public class BoundedQueueReportingActor : MailboxReportingActor, IRequiresMessag
105
105
106
106
}
107
107
108
- private IMessageQueue CheckMailBoxType ( Props props , string name , IEnumerable < Type > expectedMailboxTypes )
108
+ private async Task < IMessageQueue > CheckMailBoxType ( Props props , string name , IEnumerable < Type > expectedMailboxTypes )
109
109
{
110
110
var actor = Sys . ActorOf ( props , name ) ;
111
111
actor . Tell ( "ping" ) ;
112
112
113
- var mailbox = ExpectMsg < IMessageQueue > ( msg =>
113
+ var mailbox = await ExpectMsgAsync < IMessageQueue > ( msg =>
114
114
{
115
115
expectedMailboxTypes . ForEach ( type => Assert . True ( type . IsAssignableFrom ( msg . GetType ( ) ) ,
116
- String . Format ( CultureInfo . InvariantCulture , "Type [{0}] is not assignable to [{1}]" , msg . GetType ( ) , type ) ) ) ;
116
+ string . Format ( CultureInfo . InvariantCulture , "Type [{0}] is not assignable to [{1}]" , msg . GetType ( ) , type ) ) ) ;
117
117
} ) ;
118
118
119
119
return mailbox ;
@@ -124,52 +124,52 @@ private IMessageQueue CheckMailBoxType(Props props, string name, IEnumerable<Typ
124
124
#region Test cases
125
125
126
126
[ Fact ( DisplayName = @"Actors get an unbounded mailbox by default" ) ]
127
- public void Actors_get_unbounded_mailbox_by_default ( )
127
+ public async Task Actors_get_unbounded_mailbox_by_default ( )
128
128
{
129
- CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) , "default-default" , new [ ] { typeof ( UnboundedMessageQueue ) } ) ;
129
+ await CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) , "default-default" , new [ ] { typeof ( UnboundedMessageQueue ) } ) ;
130
130
}
131
131
132
132
[ Fact ( DisplayName = @"Actors get an unbounded deque message queue when it is only configured on the props" ) ]
133
- public void Actors_get_unbounded_dequeue_mailbox_when_configured_in_properties ( )
133
+ public async Task Actors_get_unbounded_dequeue_mailbox_when_configured_in_properties ( )
134
134
{
135
- CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) . WithMailbox ( "unbounded-mailbox" ) ,
135
+ await CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) . WithMailbox ( "unbounded-mailbox" ) ,
136
136
"default-override-from-props" , new [ ] { typeof ( UnboundedDequeMessageQueue ) } ) ;
137
137
}
138
138
139
139
[ Fact ( DisplayName = @"Actors get an unbounded deque message queue when it's only mixed with Stash" ) ]
140
- public void Actors_get_unbounded_mailbox_when_configured_with_stash_only ( )
140
+ public async Task Actors_get_unbounded_mailbox_when_configured_with_stash_only ( )
141
141
{
142
- CheckMailBoxType ( Props . Create < StashMailboxReportingActor > ( ) ,
142
+ await CheckMailBoxType ( Props . Create < StashMailboxReportingActor > ( ) ,
143
143
"default-override-from-stash" , new [ ] { typeof ( UnboundedDequeMessageQueue ) } ) ;
144
144
145
- CheckMailBoxType ( Props . Create ( ( ) => new StashMailboxReportingActor ( ) ) ,
145
+ await CheckMailBoxType ( Props . Create ( ( ) => new StashMailboxReportingActor ( ) ) ,
146
146
"default-override-from-stash2" , new [ ] { typeof ( UnboundedDequeMessageQueue ) } ) ;
147
147
148
- CheckMailBoxType ( Props . Create < StashMailboxWithParamsReportingActor > ( 10 , "foo" ) ,
148
+ await CheckMailBoxType ( Props . Create < StashMailboxWithParamsReportingActor > ( 10 , "foo" ) ,
149
149
"default-override-from-stash3" , new [ ] { typeof ( UnboundedDequeMessageQueue ) } ) ;
150
150
151
- CheckMailBoxType ( Props . Create ( ( ) => new StashMailboxWithParamsReportingActor ( 10 , "foo" ) ) ,
151
+ await CheckMailBoxType ( Props . Create ( ( ) => new StashMailboxWithParamsReportingActor ( 10 , "foo" ) ) ,
152
152
"default-override-from-stash4" , new [ ] { typeof ( UnboundedDequeMessageQueue ) } ) ;
153
153
}
154
154
155
155
[ Fact ( DisplayName = "Actors get an unbounded deque message queue when it's configured as mailbox" ) ]
156
- public void Actors_get_unbounded_dequeue_message_queue_when_configured_as_mailbox ( )
156
+ public async Task Actors_get_unbounded_dequeue_message_queue_when_configured_as_mailbox ( )
157
157
{
158
- CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) , "default-unboundeded-deque" ,
158
+ await CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) , "default-unboundeded-deque" ,
159
159
new [ ] { typeof ( UnboundedDequeMessageQueue ) } ) ;
160
160
}
161
161
162
162
[ Fact ( DisplayName = "Actor get an unbounded message queue when defined in dispatcher" ) ]
163
- public void Actor_gets_configured_mailbox_from_dispatcher ( )
163
+ public async Task Actor_gets_configured_mailbox_from_dispatcher ( )
164
164
{
165
- CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) , "unbounded-default" ,
165
+ await CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) , "unbounded-default" ,
166
166
new [ ] { typeof ( UnboundedDequeMessageQueue ) } ) ;
167
167
}
168
168
169
169
[ Fact ( DisplayName = "get an unbounded message queue with a task dispatcher" ) ]
170
- public void Actors_gets_unbounded_mailbox_with_task_dispatcher ( )
170
+ public async Task Actors_gets_unbounded_mailbox_with_task_dispatcher ( )
171
171
{
172
- CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) . WithDispatcher ( "task-dispatcher" ) ,
172
+ await CheckMailBoxType ( Props . Create < MailboxReportingActor > ( ) . WithDispatcher ( "task-dispatcher" ) ,
173
173
"unbounded-tasks" , new [ ] { typeof ( UnboundedMessageQueue ) } ) ;
174
174
}
175
175
0 commit comments