public void TestAlertWithHostsAndNoConnection() { XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "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 }); IUnitTestVerifier validator = new VerifyGetters(alert); validator.Verify(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 TestAlertWithHostsAndNoConnection() { XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, "http://url", new List <XenServerPatch>(), new List <XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123"); var alert = new XenServerVersionAlert(ver); alert.IncludeHosts(new List <Host> { hostA.Object, hostB.Object }); IUnitTestVerifier validator = new VerifyGetters(alert); validator.Verify(new AlertClassUnitTestData { AppliesTo = "HostAName, HostBName", FixLinkText = "Go to Web Page", HelpID = "XenServerUpdateAlert", Description = "name is now available. Download the latest at the " + XenAdmin.Branding.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 VerifyStoredDataWithDefaultConstructor() { IUnitTestVerifier validator = new VerifyGetters(new DuplicateIqnAlert(new Host(), new Dictionary <Host, Host>())); validator.Verify(new ClassData { FixLinkText = "Edit IQN", HelpID = "DuplicateIqnAlert", HelpLinkText = "Help", Title = "iSCSI-IQN Exists", Priority = "Priority3" }); }
public void VerifyStoredDataWithDefaultConstructor() { IUnitTestVerifier validator = new VerifyGetters(new XenCenterUpdateAlert(new XenCenterVersion("6.0.2", "xc", true, false, "http://url", new DateTime(2011, 12, 09).ToString()))); validator.Verify(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 VerifyStoredDataWithDefaultConstructor() { IUnitTestVerifier validator = new VerifyGetters(new GuiOldAlert()); validator.Verify(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() { IUnitTestVerifier validator = new VerifyGetters(new MissingIqnAlert(new Host())); validator.Verify(new AlertClassUnitTestData { AppliesTo = null, 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 TestAlertWithNoConnectionAndNoHosts() { XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "5"); XenServerPatchAlert alert = new XenServerPatchAlert(p); IUnitTestVerifier validator = new VerifyGetters(alert); validator.Verify(new AlertClassUnitTestData { AppliesTo = string.Empty, FixLinkText = "Go to Web Page", HelpID = "XenServerPatchAlert", Description = "My description", HelpLinkText = "Help", Title = "New Update Available - name", Priority = "Priority5" }); Assert.IsTrue(alert.CanIgnore); VerifyConnExpectations(Times.Never); VerifyHostsExpectations(Times.Never); }
public void TestAlertWithNoConnectionAndNoHosts() { XenServerVersion ver = new XenServerVersion("1.2.3", "name", true, "http://url", new List <XenServerPatch>(), new DateTime(2011, 4, 1).ToString(), "123"); XenServerUpdateAlert alert = new XenServerUpdateAlert(ver); IUnitTestVerifier validator = new VerifyGetters(alert); validator.Verify(new AlertClassUnitTestData { AppliesTo = string.Empty, FixLinkText = "Go to Web Page", HelpID = "XenServerUpdateAlert", Description = "name is now available. Download the latest at the Citrix website.", HelpLinkText = "Help", Title = "name is now available", Priority = "Priority5" }); Assert.IsTrue(alert.CanIgnore); VerifyConnExpectations(Times.Never); VerifyHostsExpectations(Times.Never); }