Example #1
0
        public void VerifyGettersAndSetters()
        {
            IUnitTestVerifier validator = new VerifyGettersAndSetters(task);
            validator.Verify(exampleData);

            IUnitTestVerifier countValidator = new VerifyPropertyCounter(task);
            countValidator.Verify(NUMBER_OF_PROPERTIES);
            Assert.AreEqual(73, task.TaskId, "Task ID as set in ctor");
        }
Example #2
0
        public void CheckClone()
        {
            IUnitTestVerifier originalTaskSetterValidator = new VerifyGettersAndSetters(task);
            IUnitTestVerifier originalTaskCounterValidator = new VerifyPropertyCounter(task);
            WlbScheduledTask clone = task.Clone();
            IUnitTestVerifier clonedTaskSetterValidator = new VerifyGettersAndSetters(clone);
            IUnitTestVerifier clonedTaskCounterValidator = new VerifyPropertyCounter(clone);

            Assert.AreNotEqual(task, clone);

            //Check contents are all equal to the expected
            originalTaskCounterValidator.Verify(NUMBER_OF_PROPERTIES);
            clonedTaskCounterValidator.Verify(NUMBER_OF_PROPERTIES);

            originalTaskSetterValidator.Verify(exampleData);
            clonedTaskSetterValidator.Verify(exampleData);

        }
        public void SettersThatSetOnlyForMROrLaterForVersionOlderThanMR()
        {

            Dictionary<string, string> inputData = new Dictionary<string, string>()
                                                        {
                                                            {"WlbVersion", "1.0"},
                                                            {"AutoBalanceEnabled", "false"},
                                                            {"AutoBalancePollIntervals", "1.0"},
                                                            {"AutoBalanceSeverity", "High"},
                                                            {"AutoBalanceAggressiveness", "High"},
                                                            {"PowerManagementEnabled", "false"},
                                                            {"PowerManagementPollIntervals", "5.0"},
                                                            {"EnableOptimizationModeSchedules", "false"} //Equal to AutomateOptimizationMode
                                                        };
            VerifyGettersAndSetters validatorGetSet = new VerifyGettersAndSetters(new WlbPoolConfiguration(inputData));

            MRSensitiveData expectedData = new MRSensitiveData()
            {
                AutoBalanceEnabled = false,
                AutoBalancePollIntervals = 1.0,
                AutoBalanceSeverity = WlbPoolAutoBalanceSeverity.High,
                AutoBalanceAggressiveness = WlbPoolAutoBalanceAggressiveness.High,
                PowerManagementEnabled = false,
                PowerManagementPollIntervals = 5.0,
                AutomateOptimizationMode = false
            };

            MRSensitiveData dataToSet = new MRSensitiveData()
            {
                AutoBalanceEnabled = true,
                AutoBalancePollIntervals = 2.0,
                AutoBalanceSeverity = WlbPoolAutoBalanceSeverity.Low,
                AutoBalanceAggressiveness = WlbPoolAutoBalanceAggressiveness.Medium,
                PowerManagementEnabled = true,
                PowerManagementPollIntervals = 7.0,
                AutomateOptimizationMode = true
            };

            validatorGetSet.VerifySettersAndGetters(expectedData, dataToSet);
        }