public void TestAlertWithHostsAndNoConnection() { XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, false, "http://url", new List <XenServerPatch>(), new List <XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123", "", false, "", "", "", "", ""); var alert = new XenServerVersionAlert(ver); alert.IncludeHosts(new List <Host> { hostA.Object, hostB.Object }); ClassVerifiers.VerifyGetters(alert, new AlertClassUnitTestData { AppliesTo = "HostAName, HostBName", FixLinkText = "Go to Web Page", HelpID = "XenServerUpdateAlert", Description = "name is now available. Download the latest at the " + BrandManager.COMPANY_NAME_SHORT + " website.", HelpLinkText = "Help", Title = "name is now available", Priority = "Priority5" }); Assert.IsFalse(alert.CanIgnore); VerifyConnExpectations(Times.Never); VerifyHostsExpectations(Times.Once); }
public void TestAlertWithHostsAndNoConnection() { XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", string.Empty, "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "1", "", ""); XenServerPatchAlert alert = new XenServerPatchAlert(p); alert.IncludeHosts(new List <Host>() { hostA.Object, hostB.Object }); ClassVerifiers.VerifyGetters(alert, new AlertClassUnitTestData { AppliesTo = "HostAName, HostBName", FixLinkText = "Go to Web Page", HelpID = "XenServerPatchAlert", Description = "My description", HelpLinkText = "Help", Title = "New Update Available - name", Priority = "Priority1" }); Assert.IsFalse(alert.CanIgnore); VerifyConnExpectations(Times.Never); VerifyHostsExpectations(Times.Once); }
public void SettersTest() { var inputData = new Dictionary <string, string> { { "WlbVersion", "6.0" }, { "AutoBalanceEnabled", "false" }, { "AutoBalancePollIntervals", "0.333333" }, { "AutoBalanceSeverity", "High" }, { "AutoBalanceAggressiveness", "High" }, { "PowerManagementEnabled", "false" }, { "PowerManagementPollIntervals", "5.321264" }, { "EnableOptimizationModeSchedules", "false" } //Equal to AutomateOptimizationMode }; var expectedData = new MRSensitiveData { AutoBalanceEnabled = true, AutoBalancePollIntervals = 2.0, AutoBalanceSeverity = WlbPoolAutoBalanceSeverity.Low, AutoBalanceAggressiveness = WlbPoolAutoBalanceAggressiveness.Medium, PowerManagementEnabled = true, PowerManagementPollIntervals = 7.0, AutomateOptimizationMode = true }; ClassVerifiers.VerifySettersAndGetters(new WlbPoolConfiguration(inputData), expectedData); }
public void VerifyStoredDataWithDefaultConstructor() { ClassVerifiers.VerifyGetters(new DuplicateIqnAlert(new Host(), new Dictionary <Host, Host>()), new ClassData { FixLinkText = "Edit IQN", HelpID = "DuplicateIqnAlert", HelpLinkText = "Help", Title = "iSCSI-IQN Exists", Priority = "Priority3" }); }
public void CheckClone() { WlbScheduledTask clone = task.Clone(); Assert.AreNotEqual(task, clone); //Check contents are all equal to the expected ClassVerifiers.VerifyPropertyCounter(task, NUMBER_OF_PROPERTIES); ClassVerifiers.VerifyPropertyCounter(clone, NUMBER_OF_PROPERTIES); ClassVerifiers.VerifySettersAndGetters(task, exampleData); ClassVerifiers.VerifySettersAndGetters(clone, exampleData); }
public void VerifyStoredDataWithDefaultConstructor() { ClassVerifiers.VerifyGetters(new GuiOldAlert(), new AlertClassUnitTestData { AppliesTo = XenAdmin.Branding.BRAND_CONSOLE, Description = "There is a newer version of " + XenAdmin.Branding.BRAND_CONSOLE + " available. Please contact your support representative.", FixLinkText = "Go to Web Page", HelpID = "GuiOldAlert", HelpLinkText = "Help", Title = "Newer " + XenAdmin.Branding.BRAND_CONSOLE + " Available", Priority = "Priority5" }); }
public void VerifyStoredDataWithDefaultConstructor() { ClassVerifiers.VerifyGetters(new MissingIqnAlert(new Host()), new AlertClassUnitTestData { AppliesTo = "", FixLinkText = "Edit IQN", HelpID = "MissingIqnAlert", Description = " has no iSCSI-IQN. This could cause problems with iSCSI storage on this network.", HelpLinkText = "Help", Title = "iSCSI-IQN Missing", Priority = "Priority3" }); }
public void SettersThatSetVerbatim() { var 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" } }; var 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 }; ClassVerifiers.VerifySettersAndGetters(new WlbPoolConfiguration(inputData), data); }
public void VerifyStoredDataWithDefaultConstructor() { var version = new XenCenterVersion("6.0.2", "xc", true, false, "http://url", new DateTime(2011, 12, 09).ToString()); ClassVerifiers.VerifyGetters(new XenCenterUpdateAlert(version), new AlertClassUnitTestData { AppliesTo = XenAdmin.Branding.BRAND_CONSOLE, FixLinkText = "Go to Web Page", HelpID = "XenCenterUpdateAlert", Description = "xc is now available. Download the new version from the " + XenAdmin.Branding.COMPANY_NAME_SHORT + " website.", HelpLinkText = "Help", Title = "xc is now available", Priority = "Priority5" }); }
public void GettersAndSetters() { var expected = new SubscriptionData { Id = "subs Id", Created = new DateTime(2011, 12, 25), Name = "my name", Description = "meaningful description", SubscriberId = "1", SubscriberName = "subscriber name", ScheduleId = "2", DaysOfWeek = WlbScheduledTask.WlbTaskDaysOfWeek.Monday, ExecuteTimeOfDay = new DateTime(2011, 12, 26), TriggerType = 3, Enabled = true, EnableDate = new DateTime(2011, 12, 27), LastTouched = new DateTime(2011, 12, 28), LastTouchedBy = "wasn't me!!", LastRun = new DateTime(2011, 12, 29), LastRunResult = "broken", EmailTo = "you", EmailReplyTo = "definitely you", ReportRenderFormat = 4, EmailSubject = "stuff is broken", EmailComment = "badly", EmailCc = "me", EmailBcc = "someone else", ReportId = 5, ReportName = "Report name", ReportParameters = new Dictionary <string, string>() { { "key", "value" } }, ReportDisplayName = "Display name" }; ClassVerifiers.VerifySettersAndGetters(new WlbReportSubscription("some id"), expected); }
public void XapiFriendlyNameStaticMethodsReturnStrings() { ClassVerifiers.VerifyStaticMethodReturn(typeof(FriendlyErrorNames), typeof(string)); }
public void InvisibleMessagesStaticMethodsReturnStrings() { ClassVerifiers.VerifyStaticMethodReturn(typeof(InvisibleMessages), typeof(string)); }
public void VerifyGettersAndSetters() { ClassVerifiers.VerifySettersAndGetters(task, exampleData); ClassVerifiers.VerifyPropertyCounter(task, NUMBER_OF_PROPERTIES); Assert.AreEqual(73, task.TaskId, "Task ID as set in ctor"); }