コード例 #1
0
        public void SettersThatSetVerbatim()
        {
            Dictionary <string, string> inputData = new Dictionary <string, string>()
            {
                //Simple setters.....
                { "OptimizationMode", "MaximizeDensity" },                                          //PerformanceMode
                { "MetricGroomingPeriod", "2.0" },
                { "RecentMoveMinutes", "2.0" },
                //{"ReportingUseRSServer", "false"},
                { "ReportingSMTPServer", "some string" },
                //These set ranges of values.....
                { "HostCpuThresholdCritical", "3" },
                { "HostMemoryThresholdCritical", "3.0" },
                { "HostPifReadThresholdCritical", "4.0" },                                          //HostNetworkReadThresholdCritical
                { "HostPifWriteThresholdCritical", "5.0" },                                         //HostNetworkWriteThresholdCritical
                { "HostPbdReadThresholdCritical", "6.0" },                                          //HostDiskReadThresholdCritical
                { "HostPbdWriteThresholdCritical", "7.0" },                                         //HostDiskWriteThresholdCritical
                { "VmCpuUtilizationWeightHigh", "8" },
                { "VmMemoryWeightHigh", "9" },
                { "VmDiskReadWeightHigh", "10" },
                { "VmDiskWriteWeightHigh", "11" },
                { "VmNetworkReadWeightHigh", "12" },
                { "VmNetworkWriteWeightHigh", "13" }
            };

            validator = new VerifyGettersAndSetters(new WlbPoolConfiguration(inputData));
            MRInSensitiveData data = new MRInSensitiveData()
            {
                PerformanceMode      = WlbPoolPerformanceMode.MaximizePerformance,
                MetricGroomingPeriod = 5.0,
                RecentMoveMinutes    = 6.0,
                //ReportingUseRSServer = true,
                ReportingSMTPServer               = "who knows what?!",
                HostCpuThresholdCritical          = 1,
                HostMemoryThresholdCritical       = 2,
                HostNetworkReadThresholdCritical  = 1.0,
                HostNetworkWriteThresholdCritical = 2.0,
                HostDiskReadThresholdCritical     = 3.0,
                HostDiskWriteThresholdCritical    = 4.0,
                VmCpuUtilizationWeightHigh        = 5,
                VmMemoryWeightHigh       = 6,
                VmDiskReadWeightHigh     = 7,
                VmDiskWriteWeightHigh    = 8,
                VmNetworkReadWeightHigh  = 9,
                VmNetworkWriteWeightHigh = 10
            };

            validator.Verify(data);
        }
コード例 #2
0
        public void SettersThatSetVerbatim()
        {
            Dictionary<string, string> inputData = new Dictionary<string, string>()
                                                       {
                                                           //Simple setters.....
                                                           {"OptimizationMode", "MaximizeDensity"}, //PerformanceMode
                                                           {"MetricGroomingPeriod", "2.0"},
                                                           {"RecentMoveMinutes", "2.0"},
                                                           //{"ReportingUseRSServer", "false"},
                                                           {"ReportingSMTPServer", "some string"},
                                                           //These set ranges of values.....
                                                           {"HostCpuThresholdCritical", "3"},
                                                           {"HostMemoryThresholdCritical", "3.0"},
                                                           {"HostPifReadThresholdCritical", "4.0"}, //HostNetworkReadThresholdCritical
                                                           {"HostPifWriteThresholdCritical", "5.0"}, //HostNetworkWriteThresholdCritical
                                                           {"HostPbdReadThresholdCritical", "6.0"}, //HostDiskReadThresholdCritical
                                                           {"HostPbdWriteThresholdCritical", "7.0"}, //HostDiskWriteThresholdCritical
                                                           {"VmCpuUtilizationWeightHigh", "8"},
                                                           {"VmMemoryWeightHigh", "9"},
                                                           {"VmDiskReadWeightHigh", "10"},
                                                           {"VmDiskWriteWeightHigh", "11"},
                                                           {"VmNetworkReadWeightHigh", "12"},
                                                           {"VmNetworkWriteWeightHigh", "13"}
                                                        };

            validator = new VerifyGettersAndSetters(new WlbPoolConfiguration(inputData));
            MRInSensitiveData data = new MRInSensitiveData()
                                         {
                                             PerformanceMode = WlbPoolPerformanceMode.MaximizePerformance,
                                             MetricGroomingPeriod = 5.0,
                                             RecentMoveMinutes = 6.0,
                                             //ReportingUseRSServer = true,
                                             ReportingSMTPServer = "who knows what?!",
                                             HostCpuThresholdCritical = 1,
                                             HostMemoryThresholdCritical = 2,
                                             HostNetworkReadThresholdCritical = 1.0,
                                             HostNetworkWriteThresholdCritical = 2.0,
                                             HostDiskReadThresholdCritical = 3.0,
                                             HostDiskWriteThresholdCritical = 4.0,
                                             VmCpuUtilizationWeightHigh = 5,
                                             VmMemoryWeightHigh = 6,
                                             VmDiskReadWeightHigh = 7,
                                             VmDiskWriteWeightHigh = 8,
                                             VmNetworkReadWeightHigh = 9,
                                             VmNetworkWriteWeightHigh = 10
                                         };

            validator.Verify(data);
        }