public void SearchAsync() { var client = new WindowsUpdateClient(UpdateServer.Default); var results = client.SearchAsync("IsInstalled=1", CancellationToken.None).Result; Assert.IsNotNull(results); Assert.IsNotNull(results.Updates); Assert.IsTrue(ToArray(results.Updates).Any()); }
public void DownloadAsync() { var client = new WindowsUpdateClient(UpdateServer.WindowsUpdate); var results = client.SearchAsync(CancellationToken.None).Result; Assert.IsNotNull(results); Assert.IsNotNull(results.Updates); Assert.IsTrue(ToArray(results.Updates).Any()); var downloadResult = client.DownloadAsync(results.Updates, CancellationToken.None).Result; Assert.AreEqual((int)Client.OperationResultCode.Succeeded, (int)downloadResult.ResultCode); }