mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 14:27:26 +01:00
Merge pull request #583 from MihaelaStoica/build-fix
Fix XenServerPatchAlert and XenServerUpdateAlert tests
This commit is contained in:
commit
02e2e0d2f5
@ -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;
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user