You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The following test is green in resharper test runner.

[Test]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
public void ReadOnly()
{
     throw new InvalidOperationException();
}

So make sure you check the message as well like this

        [Test]
        [ExpectedException(typeof(ArgumentOutOfRangeException),ExpectedMessage = "hoi")]
        public void ReadOnly()
        {
            throw new InvalidOperationException("kees");      
        }

The last test does show up red.

  • No labels