From 3d2e4c70cdfc9022d7e087fbde7a54cb2348e152 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Sat, 2 Dec 2017 12:46:16 +0000 Subject: [PATCH] Lowered temporarily the API version in test database to unblock the build. Use the restored Session constructor. Fixed threading issue. Signed-off-by: Konstantina Chremmou --- XenAdminTests/TestResources/small_vms.xml | 252 +++++++++++++++++- .../Diagnostics/MultipleHotfixTests.cs | 6 +- XenAdminTests/WizardTests/WizardTest.cs | 3 +- 3 files changed, 256 insertions(+), 5 deletions(-) diff --git a/XenAdminTests/TestResources/small_vms.xml b/XenAdminTests/TestResources/small_vms.xml index 77bacd845..55f5d9f6d 100644 --- a/XenAdminTests/TestResources/small_vms.xml +++ b/XenAdminTests/TestResources/small_vms.xml @@ -1 +1,251 @@ -
\ No newline at end of file + + + + + + + +
+
+ +
+ + + + + +
+ + +
+ + +
+ + + +
+ + + +
+ + + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
+ +
+ + + + + + +
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ + +
+ +
+
+
+ +
+ + + + + + + + + +
+ +
+ +
+ + +
+ +
+ + + +
+ + +
+ + +
+ +
+
+
+
+
+
+ +
+
\ No newline at end of file diff --git a/XenAdminTests/UnitTests/Diagnostics/MultipleHotfixTests.cs b/XenAdminTests/UnitTests/Diagnostics/MultipleHotfixTests.cs index 959eecdc8..39bf20357 100644 --- a/XenAdminTests/UnitTests/Diagnostics/MultipleHotfixTests.cs +++ b/XenAdminTests/UnitTests/Diagnostics/MultipleHotfixTests.cs @@ -109,7 +109,7 @@ namespace XenAdminTests.UnitTests.Diagnostics public void NoCompositeHotfixesApply() { SetUpCompositeForTwoMocks(false, false); - compositeHotfix.Apply(new Host(), new Session("url", 1, 1)); + compositeHotfix.Apply(new Host(), new Session(1, "url", 1)); VerifyCompositeForTwoMocksShouldBeApplied(); hotfixA.Verify(h => h.Apply(It.IsAny(), It.IsAny()), Times.Never()); hotfixB.Verify(h => h.Apply(It.IsAny(), It.IsAny()), Times.Never()); @@ -119,7 +119,7 @@ namespace XenAdminTests.UnitTests.Diagnostics public void OneCompositeHotfixesApply() { SetUpCompositeForTwoMocks(false, true); - compositeHotfix.Apply(new Host(), new Session("url", 1, 1)); + compositeHotfix.Apply(new Host(), new Session(1, "url", 1)); VerifyCompositeForTwoMocksShouldBeApplied(); hotfixA.Verify(h => h.Apply(It.IsAny(), It.IsAny()), Times.Never()); hotfixB.Verify(h => h.Apply(It.IsAny(), It.IsAny()), Times.Once()); @@ -129,7 +129,7 @@ namespace XenAdminTests.UnitTests.Diagnostics public void BothCompositeHotfixesApply() { SetUpCompositeForTwoMocks(true, true); - compositeHotfix.Apply(new Host(), new Session("url", 1, 1)); + compositeHotfix.Apply(new Host(), new Session(1, "url", 1)); VerifyCompositeForTwoMocksShouldBeApplied(); hotfixA.Verify(h => h.Apply(It.IsAny(), It.IsAny()), Times.Once()); hotfixB.Verify(h => h.Apply(It.IsAny(), It.IsAny()), Times.Once()); diff --git a/XenAdminTests/WizardTests/WizardTest.cs b/XenAdminTests/WizardTests/WizardTest.cs index 2373c8c09..5527b54c5 100644 --- a/XenAdminTests/WizardTests/WizardTest.cs +++ b/XenAdminTests/WizardTests/WizardTest.cs @@ -87,8 +87,9 @@ namespace XenAdminTests.WizardTests Win32.PostMessage(wizard.Handle, WM_KEYDOWN, new IntPtr((int)Keys.Enter), IntPtr.Zero); }); // wait for any progress dialog to close - while (wizard.Visible && !wizard.CanFocus) + while (MW(() => wizard.Visible && !wizard.CanFocus)) Thread.Sleep(1000); + // check if the wizard progressed to the next page Assert.AreEqual(pageNames[i + 1], CurrentPageName(wizard), "Enter key button didn't get from page: " + pageNames[i] + " to page: " + pageNames[i + 1]); }