[CA-126770],[CA-123737]: Updated test cases.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2014-04-29 14:23:53 +01:00
parent b5ede5124c
commit 49471b11b7
3 changed files with 17 additions and 2 deletions

View File

@ -146,6 +146,11 @@ namespace XenAdminTests
return GetFieldDeep<NavigationView>(o, name);
}
public static NotificationsView GetNotificationsView(object o, string name)
{
return GetFieldDeep<NotificationsView>(o, name);
}
public static DataGridViewEx GetDataGridViewEx(object o, string name)
{
return GetFieldDeep<DataGridViewEx>(o, name);

View File

@ -36,6 +36,7 @@ using System.Windows.Forms;
using NUnit.Framework;
using XenAdmin;
using XenAdmin.Controls.MainWindowControls;
using XenAdmin.Core;
using XenAdmin.TabPages;
using XenAdmin.Controls;
@ -168,10 +169,17 @@ namespace XenAdminTests.TabsAndMenus
var rows = GetVisibleRows();
Assert.AreEqual(1, rows.Count, "No connection item found.");
Assert.IsFalse(showAllButton.Enabled);
MW(() =>
{
TestUtils.GetToolStripItem(MainWindowWrapper.Item,
"navigationPane.buttonNotifySmall").PerformClick();
TestUtils.GetNotificationsView(MainWindowWrapper.Item,
"navigationPane.notificationsView").SelectNotificationsSubMode(NotificationsSubMode.Events);
});
// this should clear all items as they are all completed.
MW(() => TestUtils.GetToolStripMenuItem(MainWindowWrapper.Item,
"eventsPage.toolStripDdbFilterStatus.toolStripMenuItemComplete").PerformClick());
"eventsPage.toolStripDdbFilterStatus.toolStripMenuItemComplete").PerformClick());
rows = GetVisibleRows();
Assert.AreEqual(0, rows.Count, "Items weren't cleared.");
Assert.IsTrue(showAllButton.Enabled);

View File

@ -56,7 +56,7 @@ namespace XenAdminTests.UnitTests.AlertTests
XenServerPatchAlert alert = new XenServerPatchAlert(p);
alert.IncludeConnection(connA.Object);
alert.IncludeConnection(connB.Object);
alert.IncludeHosts(new List<Host>() { hostA.Object, hostB.Object });
alert.IncludeHosts(new List<Host> { hostA.Object, hostB.Object });
IUnitTestVerifier validator = new VerifyGetters(alert);
@ -184,9 +184,11 @@ namespace XenAdminTests.UnitTests.AlertTests
hostA = new Mock<Host>(MockBehavior.Strict);
hostA.Setup(n => n.Name).Returns("HostAName");
hostA.Setup(n => n.Equals(It.IsAny<object>())).Returns((object o) => ReferenceEquals(o, hostA.Object));
hostB = new Mock<Host>(MockBehavior.Strict);
hostB.Setup(n => n.Name).Returns("HostBName");
hostB.Setup(n => n.Equals(It.IsAny<object>())).Returns((object o) => ReferenceEquals(o, hostB.Object));
}
[TearDown]