public void NoRunSetTest() { ApplicationSettings target = new ApplicationSettings(); Rule expected = new Rule(); target.NoRunSet = expected; Rule actual = target.NoRunSet; Assert.AreEqual(expected, actual); }
public void ApproveNeededUpdatesTest() { Rule target = new Rule(); Assert.AreEqual(target.AcceptLicenseAgreement, false); Assert.AreEqual(target.ApproveNeededUpdates, false); Assert.AreEqual(target.ApproveStaleUpdates, false); Assert.AreEqual(target.ApproveSupersededUpdates, false); target.ApproveNeededUpdates = true; Assert.AreEqual(target.AcceptLicenseAgreement, false); Assert.AreEqual(target.ApproveNeededUpdates, true); Assert.AreEqual(target.ApproveStaleUpdates, false); Assert.AreEqual(target.ApproveSupersededUpdates, false); }
/// <summary> /// The do run set all classifications. /// </summary> /// <param name="server"> /// The server. /// </param> /// <param name="ctg"> /// The ctg. /// </param> /// <param name="isTest"> /// The is Test. /// </param> /// <param name="allClassifications"> /// The all Classifications. /// </param> private static void DoRunSetAllClassifications( IUpdateServer server, IComputerTargetGroup ctg, bool isTest, Rule allClassifications) { // TODO: support products in all classifications element // Microsoft.UpdateServices.Administration.UpdateCategoryCollection products = null; if (allClassifications.Copy) { // Check for copy Console.Out.WriteLine("Checking TargetGroup to Copy From: "); IComputerTargetGroup cftg = server.GetComputerTargetGroup(allClassifications.CopyFrom); Console.WriteLine("Matched copy from guid to: " + cftg.Name); CopyFrom.DoCopy(server, cftg, ctg, isTest); } if (allClassifications.ApproveSupersededUpdates) { // Check for superseded updates Console.Out.WriteLine("Checking Superseded Updates: "); CheckSupersededUpdates( server, allClassifications.AcceptLicenseAgreement, ctg, null, null, isTest, allClassifications.ShouldApproveUninstalledSupersededUpdate); } if (allClassifications.ApproveStaleUpdates) { // Check for stale updates Console.Out.WriteLine("Checking Stale Updates: "); CheckStaleUpdates(server, allClassifications.AcceptLicenseAgreement, ctg, null, null, isTest); } if (allClassifications.ApproveNeededUpdates) { CheckNeededUpdates(server, ctg, isTest); } }
public void RuleConstructorTest() { Rule target = new Rule(); }