jeudi 1 octobre 2015

Unit Testing async void MVC Controller methods don't run

I was trying to test userController to get users async by its service, doing the test method void. The thing is that everything compiles but then the test dont run.

    [TestClass]
    public class UserControllerTests
    {
       [TestMethod]
       public async void UserController_GetAll_Returns_Not_Null()
       {
        var result = await controller.GetALL();

        Assert.IsNotNull(result);
       }
    }

Aucun commentaire:

Enregistrer un commentaire