Exemplo n.º 1
0
        public void SettingInterruptOnNotRunningInstanceThrows()
        {
            var operation = new RecoveryOperation(_liveProducer, _recoveryRequestIssuerMock.Object, new[] { MessageInterest.AllMessages }, 0, false);

            operation.Interrupt(_timeProvider.Now);
            Assert.IsFalse(operation.IsRunning);
            Assert.IsNull(operation.InterruptionTime);
        }
Exemplo n.º 2
0
        public void FirstInterruptTimeIsRecorded()
        {
            var operation = new RecoveryOperation(_liveProducer, _recoveryRequestIssuerMock.Object, new[] { MessageInterest.AllMessages }, 0, false);

            operation.Start();

            _timeProvider.AddSeconds(60);
            var interruptTime = _timeProvider.Now;

            operation.Interrupt(interruptTime);


            _timeProvider.AddSeconds(60);
            operation.Interrupt(_timeProvider.Now);

            operation.TryComplete(MessageInterest.AllMessages, out var result);
            Assert.IsNotNull(result);
            Assert.AreEqual(result.InterruptedAt, interruptTime);
        }
        public void setting_interrupt_on_not_running_instance_throws()
        {
            var operation = new RecoveryOperation(LiveProducer, _recoveryRequestIssuerMock.Object, new[] { MessageInterest.AllMessages }, 0, false);

            operation.Interrupt(_timeProvider.Now);
        }