public void ExpectsFailsIfParameterValuesDontMatch() { ExpectedExceptionAttribute attr = new ExpectedExceptionAttribute(typeof(FileNotFoundException), "No such file."); FileNotFoundException exception = new FileNotFoundException("A totally different message."); Assert.False(attr.Expects(exception)); }
public void InstantiateWithParameterList() { ExpectedExceptionAttribute attr = new ExpectedExceptionAttribute(typeof(FileNotFoundException), "No such file."); FileNotFoundException exception = new FileNotFoundException("No such file."); Assert.True(attr.Expects(exception)); }
public void ExpectedArgumentNullException() { ExpectedExceptionAttribute attr = new ExpectedExceptionAttribute(typeof(ArgumentNullException), "fileName"); Assert.True(attr.Expects(new ArgumentNullException("fileName"))); }