Beispiel #1
0
        public void Cleanup_ShouldCall_Origin_Cleanup()
        {
            var updates = new SafeAppUpdates(_logger, _appUpdates);

            updates.Cleanup();

            _appUpdates.Received().Cleanup();
        }
Beispiel #2
0
        public void Cleanup_ShouldLog_AppUpdateException()
        {
            _appUpdates.When(x => x.Cleanup()).Do(x => throw new AppUpdateException(""));
            var updates = new SafeAppUpdates(_logger, _appUpdates);

            updates.Cleanup();

            _logger.ReceivedWithAnyArgs().Error("");
        }
Beispiel #3
0
        public void Cleanup_ShouldSuppress_AppUpdateException()
        {
            _appUpdates.When(x => x.Cleanup()).Do(x => throw new AppUpdateException(""));
            var updates = new SafeAppUpdates(_logger, _appUpdates);

            Action action = () => updates.Cleanup();

            action.Should().NotThrow();
        }
Beispiel #4
0
        public void Cleanup_ShouldPass_Exception()
        {
            _appUpdates.When(x => x.Cleanup()).Do(x => throw new SomeException());
            var updates = new SafeAppUpdates(_logger, _appUpdates);

            Action action = () => updates.Cleanup();

            action.Should().Throw <SomeException>();
        }