(5.6) NUnit's ExpectedException Attribute is gone?

I just upgraded to Unity 5.6, and to my surprise a ton of my unit tests no longer compiles. It looks as if the ExpectedException attribute can no longer be found.

error CS0246: The type or namespace name `ExpectedException' could not be found. Are you missing an assembly reference?

This is not only affecting my project, but some of my (more well tested) purchased plugins as well.
I’ve gone through the change log for 5.6, but I can’t find any changes whatsoever to NUnit or the test runner.

Whats going on?

In Unity 5.6 they updated to NUnit 3. And in NUnit 3, they decided to remove this attribute. They claim th at instead of having an attribute that expects an exception, that it should be a separately written unit test. I don’t know if I necessarily agree with the decision, but this is what you’re seeing.

The issue here, is that if you install the Unity Test Tools in 5.6, you are effectively installing an error, as this code is added by default:

        [Test]
        [ExpectedException(typeof(ArgumentException), ExpectedMessage = "expected message")]
        public void ExpectedExceptionTest()
        {
            throw new ArgumentException("expected message");
        }

@LavaPatrik Replace whole method and all it’s attributes with:

[Test]
        public void ExpectedExceptionTest()
        {
            Assert.Throws<ArgumentException>(delegate()
            {
                throw new ArgumentException ("expected message");
            });
        }

Yes, they moved it…
https://github.com/nunit/nunit/issues/113

To here…
https://github.com/nunit/nunit-csharp-samples/tree/master/ExpectedExceptionExample