Moq With Async Opetaions

105 views
Skip to first unread message

Amit Modi

unread,
May 11, 2013, 2:14:01 AM5/11/13
to moq...@googlegroups.com
Hi ..
I have following method in interface:
 Task<IEnumerable<Address>> LoadAddressesAsync(Guid partyId);

I want to mock it and return dummy data.

Can any one help me to provide the syntax.

Daniel Cazzulino

unread,
May 11, 2013, 5:11:26 AM5/11/13
to moqdisc
foo.Setup(x => x.LoadAddresssesAsync(It.IsAny<Guid>())).Returns(() => Task.Run(() => new [] { address1, address2 });



/kzu

--
Daniel Cazzulino


--
--
Post: moq...@googlegroups.com
Unsubscribe: moqdisc-u...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "Moq Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moqdisc+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages