public void GuidTest()
 {
     Classification target = new Classification(); // TODO: Initialize to an appropriate value
     Guid expected = Guid.NewGuid();
     target.Guid = expected;
     Guid actual = target.Guid;
     Assert.AreEqual(expected, actual);
 }
Exemple #2
0
        /// <summary>
        /// The do run set classification.
        /// </summary>
        /// <param name="server">
        /// Object representing the WSUS server
        /// </param>
        /// <param name="computerTargetGroup">
        /// The target group to check
        /// </param>
        /// <param name="classification">
        /// </param>
        /// <param name="isTest">
        /// Whether we are in test mode
        /// </param>
        /// <param name="alreadyProcessed">
        /// List of target groups that have already been processed
        /// </param>
        private static void DoRunSetClassification(
            IUpdateServer server,
            IComputerTargetGroup computerTargetGroup,
            Classification classification,
            bool isTest,
            List<IComputerTargetGroup> alreadyProcessed)
        {
            // check the classification exists on wsus
            IUpdateClassification uc = server.GetUpdateClassification(classification.Guid);

            // check for a product collection
            UpdateCategoryCollection products = classification.Products.ElementInformation.IsPresent
                                                    ? GetUpdateCategoryCollection(server, classification.Products)
                                                    : null;

            if (classification.ApproveStaleUpdates)
            {
                CheckStaleUpdates(
                    server,
                    classification.AcceptLicenseAgreement,
                    computerTargetGroup,
                    uc,
                    products,
                    isTest);
            }

            if (classification.ApproveSupersededUpdates)
            {
                CheckSupersededUpdates(
                    server,
                    classification.AcceptLicenseAgreement,
                    computerTargetGroup,
                    uc,
                    products,
                    isTest,
                    classification.ShouldApproveUninstalledSupersededUpdate);
            }

            if (classification.ApproveNeededUpdates)
            {
                CheckClassification(server, uc, computerTargetGroup, isTest, alreadyProcessed);
            }
        }
        public void ItemTest()
        {
            ClassificationCollection target = new ClassificationCollection();

            int index = 0;
            Classification expected = new Classification();
            target.Add(expected);
            Classification actual = target[index];
            Assert.AreEqual(expected, actual);
        }
 public void ClassificationConstructorTest()
 {
     Classification target = new Classification();
 }