title: ExpectedException Attribute Usage
body: <p>I am trying to work with the <code>ExpectedException</code> attribute in a <code>C# UnitTest</code>, but I am having issues getting it to work with my particular <code>Exception</code>. Here's what I got:</p>
  
  <p><strong>NOTE:</strong> I wrapped asterisks around the line that is giving me the trouble.</p>
  
  <pre><code>    [ExpectedException(typeof(Exception))]
      public void TestSetCellContentsTwo()
      {
          // Create a new Spreadsheet instance for this test:
          SpreadSheet = new Spreadsheet();
  
          // If name is null then an InvalidNameException should be thrown. Assert that the correct 
          // exception was thrown.
          ReturnVal = SpreadSheet.SetCellContents(null, "String Text");
          **Assert.IsTrue(ReturnVal is InvalidNameException);**
  
          // If text is null then an ArgumentNullException should be thrown. Assert that the correct
          // exception was thrown.
          ReturnVal = SpreadSheet.SetCellContents("A1", (String) null);
          Assert.IsTrue(ReturnVal is ArgumentNullException);
  
          // If name is invalid then an InvalidNameException should be thrown. Assert that the correct 
          // exception was thrown.
          {
              ReturnVal = SpreadSheet.SetCellContents("25", "String Text");
              Assert.IsTrue(ReturnVal is InvalidNameException);
  
              ReturnVal = SpreadSheet.SetCellContents("2x", "String Text");
              Assert.IsTrue(ReturnVal is InvalidNameException);
  
              ReturnVal = SpreadSheet.SetCellContents("&amp;", "String Text");
              Assert.IsTrue(ReturnVal is InvalidNameException);
          }
      }
  </code></pre>
  
  <p>I have the <code>ExpectedException</code> catching the base type <code>Exception</code>. Shouldn't this take care of it? I have tried using <code>AttributeUsage</code>, but it wasn't helping either. I know I can wrap it in a try/catch block, but I'd like to see if I can figure this style out.</p>
  
  <p>Thanks all!</p>