public void Search() { var client = new WindowsUpdateClient(UpdateServer.Default); var results = client.Search("IsInstalled=1"); Assert.IsNotNull(results); Assert.IsNotNull(results.Updates); Assert.IsTrue(ToArray(results.Updates).Any()); }
public void GetAllUpdates() { const string Criteria = "IsHidden=0 AND DeploymentAction=*"; var client = new WindowsUpdateClient(UpdateServer.WindowsUpdate); var results = client.Search(Criteria); Assert.IsNotNull(results); Assert.IsNotNull(results.Updates); Assert.IsTrue(ToArray(results.Updates).Any()); }
public void Download() { var client = new WindowsUpdateClient(UpdateServer.WindowsUpdate); var results = client.Search(); Assert.IsNotNull(results); Assert.IsNotNull(results.Updates); Assert.IsTrue(ToArray(results.Updates).Any()); var downloadResult = client.Download(results.Updates); Assert.AreEqual((int)Client.OperationResultCode.Succeeded, (int)downloadResult.ResultCode); }