public void ShouldClearCurrentContextEvenIfExceptionIsThrownDuringInvocation() { dynamic obj = new ProtoObject(); obj.Prototype.Throw = (Action)(() => { throw new Exception("It Blew Up!"); }); Assert.Null(Proto.CurrentContext); Assert.Throws <Exception>(() => obj.Throw()); Assert.Null(Proto.CurrentContext); }
public void ShouldClearCurrentContextEvenIfExceptionIsThrownDuringInvocation() { dynamic obj = new ProtoObject(); obj.Prototype.Throw = (Action)(() => { throw new Exception("It Blew Up!"); }); Assert.Null(Proto.CurrentContext); Assert.Throws<Exception>(() => obj.Throw()); Assert.Null(Proto.CurrentContext); }