Merge pull request #583 from MihaelaStoica/build-fix

Fix XenServerPatchAlert and XenServerUpdateAlert tests
This commit is contained in:
Gabor Apati-Nagy 2015-07-27 18:10:22 +01:00
commit 02e2e0d2f5
2 changed files with 18 additions and 0 deletions

View File

@ -49,6 +49,9 @@ namespace XenAdminTests.UnitTests.AlertTests
private Mock<Host> hostA;
private Mock<Host> hostB;
protected Cache cacheA;
protected Cache cacheB;
[Test]
public void TestAlertWithConnectionAndHosts()
{
@ -178,9 +181,13 @@ namespace XenAdminTests.UnitTests.AlertTests
{
connA = new Mock<IXenConnection>(MockBehavior.Strict);
connA.Setup(n => n.Name).Returns("ConnAName");
cacheA = new Cache();
connA.Setup(x => x.Cache).Returns(cacheA);
connB = new Mock<IXenConnection>(MockBehavior.Strict);
connB.Setup(n => n.Name).Returns("ConnBName");
cacheB = new Cache();
connB.Setup(x => x.Cache).Returns(cacheB);
hostA = new Mock<Host>(MockBehavior.Strict);
hostA.Setup(n => n.Name).Returns("HostAName");
@ -194,6 +201,8 @@ namespace XenAdminTests.UnitTests.AlertTests
[TearDown]
public void TestTearDown()
{
cacheA = null;
cacheB = null;
connA = null;
connB = null;
hostA = null;

View File

@ -49,6 +49,9 @@ namespace XenAdminTests.UnitTests.AlertTests
private Mock<Host> hostA;
private Mock<Host> hostB;
protected Cache cacheA;
protected Cache cacheB;
[Test]
public void TestAlertWithConnectionAndHosts()
{
@ -178,9 +181,13 @@ namespace XenAdminTests.UnitTests.AlertTests
{
connA = new Mock<IXenConnection>(MockBehavior.Strict);
connA.Setup(n => n.Name).Returns("ConnAName");
cacheA = new Cache();
connA.Setup(x => x.Cache).Returns(cacheA);
connB = new Mock<IXenConnection>(MockBehavior.Strict);
connB.Setup(n => n.Name).Returns("ConnBName");
cacheB = new Cache();
connB.Setup(x => x.Cache).Returns(cacheB);
hostA = new Mock<Host>(MockBehavior.Strict);
hostA.Setup(n => n.Name).Returns("HostAName");
@ -194,6 +201,8 @@ namespace XenAdminTests.UnitTests.AlertTests
[TearDown]
public void TestTearDown()
{
cacheA = null;
cacheB = null;
connA = null;
connB = null;
hostA = null;