public void Cleanup_ShouldCall_Origin_Cleanup() { var updates = new SafeAppUpdates(_logger, _appUpdates); updates.Cleanup(); _appUpdates.Received().Cleanup(); }
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(""); }
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(); }
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>(); }