I have a test declared as:
[Test]
[ExpectedException(typeof(FaultException<ArgumentException>))]
public void ShouldNotBeAbleToDeleteASystemList()
When I run this in VS2008 targeting .net 3.5 it all works fine and the test passes as the exception is thrown.
I have migrated the solution to VS2010 and changed the target framework to 4.0 and now the test fails with the following details:
System.ServiceModel.FaultException`1[[System.ArgumentException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] was expected
When I write the actual message to the console it is:
System.ServiceModel.FaultException`1[System.ArgumentException]: This is a system list and cannot be deleted (Fault Detail is equal to System.ArgumentException: Value does not fall within the expected range.).
I have checked and all projects are targeting .net 4.0.
What is going wrong?