public async Task TestCloseForUpdateAsks() { application.CanClose().Returns(Task.FromResult(false)); var updateService = new UpdateService(data, clientFactory, applicationVersion, application, fileSystem, standaloneUpdate, settings, platformService); await updateService.CloseForUpdate(); await application.Received().CanClose(); application.DidNotReceive().ForceClose(); standaloneUpdate.DidNotReceive().Launch(); }
public async Task CloseForUpdate() { if (!await application.CanClose()) { return; } standaloneUpdater.Launch(); application.ForceClose(); }