开发者

Building unit tests for asp.net mvc2 async controller actions that return data

开发者 https://www.devze.com 2023-03-22 07:24 出处:网络
I\'ve had a good look around and I can\'t seem a specific answer to the above question. For example, this thread:

I've had a good look around and I can't seem a specific answer to the above question. For example, this thread:

Building unit tests for MVC2 AsyncControllers

talks about waiting for async a开发者_如何学JAVActions to finish, which is great, but I then need to be able to retrieve the data returned from the Completed method.

Cheers, Andrew.


one way is to do this is make the event handler:

controller.AsyncManager.Finished += (sender, ev) => {
                                                  var result = controller.TransactionCompleted();
                                                  trigger.Set();
                                                }
0

精彩评论

暂无评论...
验证码 换一张
取 消