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

View File

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