public void TargetGroupsTest()
 {
     RunSet target = new RunSet();
     TargetGroupCollection expected = new TargetGroupCollection();
     target.TargetGroups = expected;
     TargetGroupCollection actual = target.TargetGroups;
     Assert.AreEqual(expected, actual);
 }
Exemple #2
0
        /// <summary>
        /// performs a specific run set
        /// </summary>
        /// <param name="server">
        /// The WSUS Server
        /// </param>
        /// <param name="runSet">
        /// A specific run set
        /// </param>
        /// <param name="isTest">
        /// Whether we are in test mode
        /// </param>
        private static void DoRunSet(IUpdateServer server, RunSet runSet, bool isTest)
        {
            Console.WriteLine("Performing Run Set: " + runSet.Name);

            // get the target group rules
            Configuration.CheckIsValidRunSet(server, runSet);

            var alreadyProcessed = new List<IComputerTargetGroup>();

            if (runSet.TargetGroups.ElementInformation.IsPresent)
            {
                Console.WriteLine("Target Groups specified in Run Set.");
                TargetGroupCollection targetGroups = runSet.TargetGroups;
                foreach (TargetGroup targetGroup in targetGroups)
                {
                    DoRunSetTargetGroup(server, targetGroup, isTest, alreadyProcessed);
                }
            }
            else if (runSet.AllTargetGroups.ElementInformation.IsPresent)
            {
                AllTargetGroups allTargetGroups = runSet.AllTargetGroups;
                DoRunSetAllTargetGroups(server, allTargetGroups, isTest, alreadyProcessed);
            }
            else
            {
                throw new ConfigurationErrorsException(
                    "Couldn't find a \"targetGroup\" or \"allTargetGroups\" element in the runset.");
            }
        }
 public void RunSetConstructorTest()
 {
     //SmartApprove.Model.ApplicationSettings appSettings = SmartApprove.Program.LoadSettings();
     RunSet target = new RunSet();
 }
 public void ItemTest()
 {
     RunSetCollection target = new RunSetCollection();
     int index = 0;
     RunSet expected = new RunSet();
     target.Add(expected);
     RunSet actual = target[index];
     Assert.AreEqual(expected, actual);
 }