コード例 #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));
        }
コード例 #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));
        }
コード例 #3
0
        public void ExpectedArgumentNullException()
        {
            ExpectedExceptionAttribute attr = new ExpectedExceptionAttribute(typeof(ArgumentNullException), "fileName");

            Assert.True(attr.Expects(new ArgumentNullException("fileName")));
        }
コード例 #4
0
 public void ExpectedArgumentNullException() {
    ExpectedExceptionAttribute attr = new ExpectedExceptionAttribute(typeof(ArgumentNullException), "fileName");
    Assert.True(attr.Expects(new ArgumentNullException("fileName")));
 }
コード例 #5
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));
 }
コード例 #6
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));
 }