public void IsClosedAfterClose() { var mockRepository = new MockRepository(); var rabbitModel = mockRepository.DynamicMock<IModel>(); var consumeToken = new ConsumeToken("tag", rabbitModel); consumeToken.Close(); Assert.True(consumeToken.IsClosed); }
public void CancelsOnClose() { var mockRepository = new MockRepository(); var rabbitModel = mockRepository.DynamicMock<IModel>(); using (mockRepository.Record()) { Expect.Call(() => rabbitModel.BasicCancel("tag")); } using (mockRepository.Playback()) { var consumeToken = new ConsumeToken("tag", rabbitModel); consumeToken.Close(); } }