I need to write a unit test for the next function and I saw I can use [ExpectedException]
this is the function to be tested.
public static T FailIfEnumIs
You don't need an assertion if you're using ExpectedException attribute, in fact your code shouldn't be able to arrive at the assertion.
look: http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.expectedexceptionattribute.aspx
If you want to be sure the exception is thrown you should put an Assert.Fail() after the operation that should throw the exception, in this case if the exception is not thrown, the test will fail.