How to make a test fail if it takes too long?

Asked

Viewed 200 times

20

I’m using Mstest which is the default drive testing platform in visual studio and have this test here:

    [TestMethod]
    [ExpectedException(typeof(InvalidOperationException))]
    public void Board_nao_destroi_unidades_flutuantes()
    {
        var ctor = new Construction();
        Board.Unities.Add(ctor);
        Board.DestroyAllUnities();
    }

He’s waiting for an Exception to pass but instead he loops and delays the other 92 tests. What’s the way to say that if my test linger a certain amount of milliseconds it will fail?

1 answer

11


  • Solved obrg. I knew that existed only did not know how to look.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.