Exemple #1
0
        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));
        }
Exemple #2
0
        public void InstantiateWithParameterList()
        {
            ExpectedExceptionAttribute attr      = new ExpectedExceptionAttribute(typeof(FileNotFoundException), "No such file.");
            FileNotFoundException      exception = new FileNotFoundException("No such file.");

            Assert.True(attr.Expects(exception));
        }
Exemple #3
0
        public void ExpectedArgumentNullException()
        {
            ExpectedExceptionAttribute attr = new ExpectedExceptionAttribute(typeof(ArgumentNullException), "fileName");

            Assert.True(attr.Expects(new ArgumentNullException("fileName")));
        }
 public void ExpectedArgumentNullException() {
    ExpectedExceptionAttribute attr = new ExpectedExceptionAttribute(typeof(ArgumentNullException), "fileName");
    Assert.True(attr.Expects(new ArgumentNullException("fileName")));
 }
 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));
 }