public void TestUnsubscribeInEndedCallback() { TestTransaction monitored = new TestTransaction(); UnsubscribingTransaction test = new UnsubscribingTransaction(monitored); Mock <ITransactionSubscriber> mockedSubscriber = mockSubscriber(monitored); try { mockedSubscriber.Expects.One.Method(m => m.Ended(null, null)).WithAnyArguments(); monitored.End(); this.mockery.VerifyAllExpectationsHaveBeenMet(); } finally { test.End(); } }
public void TestUnsubscribeInEndedCallback() { TestTransaction monitored = new TestTransaction(); UnsubscribingTransaction test = new UnsubscribingTransaction(monitored); ITransactionSubscriber mockedSubscriber = mockSubscriber(monitored); try { Expect.Once.On(mockedSubscriber).Method("Ended").WithAnyArguments(); monitored.End(); this.mockery.VerifyAllExpectationsHaveBeenMet(); } finally { test.End(); } }