mardi 5 juillet 2016

moq testing with an asynchronous operation does not work

I'm trying to mock test with an asynchronous method but i don't know how to set up the moq test to allow it.

noSQLProvider.Setup(x => x.CreateDocumentAsync(It.IsIn<Uri>(), It.IsAny<object>())).Returns();

the error is telling me:

Usage: ResourceResponse x = await CreatDocumentAsync(...);

an expression tree may not contain a call or invocation that uses optional arguments.

Aucun commentaire:

Enregistrer un commentaire