コード例 #1
0
        public void HasReadableDescription()
        {
            var exception = new Exception();
            var action = new ThrowAction(exception);

            AssertDescription.IsEqual(action, "throw <" + exception + ">");
        }
コード例 #2
0
        public void SetsExceptionOfInvocation()
        {
            var exception = new Exception();
            var action = new ThrowAction(exception);

            var receiver = new object();
            var methodInfo = new MethodInfoStub("method");
            var invocation = new Invocation(receiver, methodInfo, new object[0]);

            action.Invoke(invocation);

            Assert.AreSame(exception, invocation.Exception, "exception");
        }