Esempio n. 1
0
        public void IsClosedAfterClose()
        {
            var mockRepository = new MockRepository();
            var rabbitModel = mockRepository.DynamicMock<IModel>();

            var consumeToken = new ConsumeToken("tag", rabbitModel);
            consumeToken.Close();

            Assert.True(consumeToken.IsClosed);
        }
Esempio n. 2
0
        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();
            }
        }