public void RunSetsTest() { ApplicationSettings target = new ApplicationSettings(); RunSetCollection expected = new RunSetCollection(); target.RunSets = expected; RunSetCollection actual = target.RunSets; Assert.AreEqual(expected, actual); }
public void NoRunSetTest() { ApplicationSettings target = new ApplicationSettings(); Rule expected = new Rule(); target.NoRunSet = expected; Rule actual = target.NoRunSet; Assert.AreEqual(expected, actual); }
/// <summary> /// This is the path run if there are no run sets in the app.config /// This is the classic apply to all groups approach from 1.0.0.0 /// </summary> /// <param name="settings"> /// application settings /// </param> /// <param name="server"> /// The WSUS Server /// </param> /// <param name="isTest"> /// Whether we are in test mode /// </param> private static void DoNoRunSets(ApplicationSettings settings, IUpdateServer server, bool isTest) { Console.WriteLine("Performing \"No Run Set\" rule: "); // Get target groups Console.Out.WriteLine("Getting root target group: "); IComputerTargetGroup rootGroup = Server.GetRootTargetGroup(server); Console.Out.WriteLine("succeeded."); Rule defaultRule = settings.NoRunSet; if (defaultRule.ApproveSupersededUpdates) { // Check for superseded updates Console.Out.WriteLine("Checking Superseded Updates: "); CheckSupersededUpdates( server, defaultRule.AcceptLicenseAgreement, null, null, null, isTest, defaultRule.ShouldApproveUninstalledSupersededUpdate); } if (defaultRule.ApproveStaleUpdates) { // Check for stale updates Console.Out.WriteLine("Checking Stale Updates: "); CheckStaleUpdates(server, defaultRule.AcceptLicenseAgreement, null, null, null, isTest); } if (defaultRule.ApproveNeededUpdates) { CheckNeededUpdates(server, rootGroup, isTest); } }
public void ServerTest() { ApplicationSettings target = new ApplicationSettings(); SmartLib.Model.Server expected = new SmartLib.Model.Server(); target.Server = expected; SmartLib.Model.Server actual = target.Server; Assert.AreEqual(expected, actual); }