mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Merge pull request #53 from kc284/xs64bit
[CA-126770],[CA-123737]: Updated test cases.
This commit is contained in:
commit
ff2ef9af0c
@ -146,6 +146,11 @@ namespace XenAdminTests
|
|||||||
return GetFieldDeep<NavigationView>(o, name);
|
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)
|
public static DataGridViewEx GetDataGridViewEx(object o, string name)
|
||||||
{
|
{
|
||||||
return GetFieldDeep<DataGridViewEx>(o, name);
|
return GetFieldDeep<DataGridViewEx>(o, name);
|
||||||
|
@ -36,6 +36,7 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using XenAdmin;
|
using XenAdmin;
|
||||||
|
using XenAdmin.Controls.MainWindowControls;
|
||||||
using XenAdmin.Core;
|
using XenAdmin.Core;
|
||||||
using XenAdmin.TabPages;
|
using XenAdmin.TabPages;
|
||||||
using XenAdmin.Controls;
|
using XenAdmin.Controls;
|
||||||
@ -168,10 +169,17 @@ namespace XenAdminTests.TabsAndMenus
|
|||||||
var rows = GetVisibleRows();
|
var rows = GetVisibleRows();
|
||||||
Assert.AreEqual(1, rows.Count, "No connection item found.");
|
Assert.AreEqual(1, rows.Count, "No connection item found.");
|
||||||
Assert.IsFalse(showAllButton.Enabled);
|
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.
|
// this should clear all items as they are all completed.
|
||||||
MW(() => TestUtils.GetToolStripMenuItem(MainWindowWrapper.Item,
|
MW(() => TestUtils.GetToolStripMenuItem(MainWindowWrapper.Item,
|
||||||
"eventsPage.toolStripDdbFilterStatus.toolStripMenuItemComplete").PerformClick());
|
"eventsPage.toolStripDdbFilterStatus.toolStripMenuItemComplete").PerformClick());
|
||||||
rows = GetVisibleRows();
|
rows = GetVisibleRows();
|
||||||
Assert.AreEqual(0, rows.Count, "Items weren't cleared.");
|
Assert.AreEqual(0, rows.Count, "Items weren't cleared.");
|
||||||
Assert.IsTrue(showAllButton.Enabled);
|
Assert.IsTrue(showAllButton.Enabled);
|
||||||
|
@ -56,7 +56,7 @@ namespace XenAdminTests.UnitTests.AlertTests
|
|||||||
XenServerPatchAlert alert = new XenServerPatchAlert(p);
|
XenServerPatchAlert alert = new XenServerPatchAlert(p);
|
||||||
alert.IncludeConnection(connA.Object);
|
alert.IncludeConnection(connA.Object);
|
||||||
alert.IncludeConnection(connB.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);
|
IUnitTestVerifier validator = new VerifyGetters(alert);
|
||||||
|
|
||||||
@ -184,9 +184,11 @@ namespace XenAdminTests.UnitTests.AlertTests
|
|||||||
|
|
||||||
hostA = new Mock<Host>(MockBehavior.Strict);
|
hostA = new Mock<Host>(MockBehavior.Strict);
|
||||||
hostA.Setup(n => n.Name).Returns("HostAName");
|
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 = new Mock<Host>(MockBehavior.Strict);
|
||||||
hostB.Setup(n => n.Name).Returns("HostBName");
|
hostB.Setup(n => n.Name).Returns("HostBName");
|
||||||
|
hostB.Setup(n => n.Equals(It.IsAny<object>())).Returns((object o) => ReferenceEquals(o, hostB.Object));
|
||||||
}
|
}
|
||||||
|
|
||||||
[TearDown]
|
[TearDown]
|
||||||
|
Loading…
Reference in New Issue
Block a user