public void TestAlertWithConnectionAndHosts()
        {
            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);
            alert.IncludeConnection(connA.Object);
            alert.IncludeConnection(connB.Object);
            alert.IncludeHosts(new List<Host>() { hostA.Object, hostB.Object });

            IUnitTestVerifier validator = new VerifyGetters(alert);

            validator.Verify(new AlertClassUnitTestData
            {
                AppliesTo = "HostAName, HostBName, ConnAName, ConnBName",
                FixLinkText = "&Go to Web Page...",
                HelpID = "XenServerUpdateAlert",
                Description = "name is now available. Download the latest at the Citrix website (April 1, 2011)",
                HelpLinkText = "&Help on this alert...",
                Title = "name is now available",
                Priority = "Priority5"
            });

            Assert.IsFalse(alert.CanIgnore);

            VerifyConnExpectations(Times.Once);
            VerifyHostsExpectations(Times.Once);
        }
        public void TestAlertWithConnectionAndHosts()
        {
            XenServerPatch p = new XenServerPatch("uuid", "name", "My description", "guidance", "6.0.1", "http://url", "http://patchUrl", new DateTime(2011, 4, 1).ToString(), "");
            XenServerPatchAlert alert = new XenServerPatchAlert(p);
            alert.IncludeConnection(connA.Object);
            alert.IncludeConnection(connB.Object);
            alert.IncludeHosts(new List<Host>() { hostA.Object, hostB.Object });

            IUnitTestVerifier validator = new VerifyGetters(alert);

            validator.Verify(new AlertClassUnitTestData
            {
                AppliesTo = "HostAName, HostBName, ConnAName, ConnBName",
                FixLinkText = "Go to Web Page",
                HelpID = "XenServerPatchAlert",
                Description = "My description",
                HelpLinkText = "Help",
                Title = "New Update Available - name",
                Priority = "Priority2"
            });

            Assert.IsFalse(alert.CanIgnore);

            VerifyConnExpectations(Times.Once);
            VerifyHostsExpectations(Times.Once);
        }
Exemplo n.º 3
0
        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"
            });
        }
Exemplo n.º 4
0
        public void VerifyStoredDataWithDefaultConstructor()
        {
            IUnitTestVerifier validator = new VerifyGetters(new XenCenterUpdateAlert(new XenCenterVersion("6.0.2", "xc", true, "http://url", new DateTime(2011, 12, 09).ToString())));

            validator.Verify(new AlertClassUnitTestData
            {
                AppliesTo = "XenCenter",
                FixLinkText = "&Go to Web Page...",
                HelpID = "XenCenterUpdateAlert",
                Description = "xc is now available. Download the new version from the Citrix website.",
                HelpLinkText = "&Help on this alert...",
                Title = "New XenCenter Available",
                Priority = "Priority5"
            });
        }
Exemplo n.º 5
0
        public void VerifyStoredDataWithDefaultConstructor()
        {
            IUnitTestVerifier validator = new VerifyGetters(new XenCenterUpdateAlert(new XenCenterVersion("6.0.2", "xc", true, "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 = "New " + XenAdmin.Branding.BRAND_CONSOLE + " Available",
                Priority = "Priority5"
            });
        }
Exemplo n.º 6
0
        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"
                                        });
        }
Exemplo n.º 7
0
        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 on this alert...",
                Title = "iSCSI-IQN Missing",
                Priority = "Priority3"
            });
        }
Exemplo n.º 8
0
        public void VerifyStoredDataWithDefaultConstructor()
        {
            IUnitTestVerifier validator = new VerifyGetters(new GuiOldAlert());

            validator.Verify(new AlertClassUnitTestData
                                        {
                                            AppliesTo = "XenCenter",
                                            Description = "There is a newer version of XenCenter available. Please contact your support representative.",
                                            FixLinkText = "&Go to Web Page...",
                                            HelpID = "GuiOldAlert",
                                            HelpLinkText = "&Help on this alert...",
                                            Title = "Newer XenCenter Available",
                                            Priority = "Priority5"
                                        });
        }
        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 TestAlertWithConnectionAndNoHosts()
        {
            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.IncludeConnection(connA.Object);
            alert.IncludeConnection(connB.Object);

            IUnitTestVerifier validator = new VerifyGetters(alert);

            validator.Verify(new AlertClassUnitTestData
            {
                AppliesTo = "ConnAName, ConnBName",
                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.Once);
            VerifyHostsExpectations(Times.Never);
        }
Exemplo n.º 11
0
        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 on this alert...",
                Title = "name is now available",
                Priority = "Priority5"
            });

            Assert.IsTrue(alert.CanIgnore);

            VerifyConnExpectations(Times.Never);
            VerifyHostsExpectations(Times.Never);
        }