Fixed null reference exception in tests.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2018-08-29 09:57:44 +01:00 committed by Joey
parent 12678f0afa
commit ad773d8f75
2 changed files with 10 additions and 8 deletions

View File

@ -236,6 +236,8 @@ namespace XenAdmin.Wizards.PatchingWizard
foreach (var guide in Patch.after_apply_guidance)
{
var result = GetGuidanceList(guide, serversPerPool, null, out someHostMayRequireRestart);
if (result == null)
continue;
foreach (var kvp in result)
{
if (total.ContainsKey(kvp.Key))
@ -263,6 +265,8 @@ namespace XenAdmin.Wizards.PatchingWizard
foreach (var guide in PoolUpdate.after_apply_guidance)
{
var result = GetGuidanceList(guide, serversPerPool, LivePatchCodesByHost, out someHostMayRequireRestart);
if (result == null)
continue;
foreach (var kvp in result)
{
if (total.ContainsKey(kvp.Key))

View File

@ -81,17 +81,15 @@ namespace XenAdminTests.WizardTests
TestPage(pageNames[i]);
if (!lastPage)
{
// send th eenter key to the wizard window
MW(() =>
{
Win32.PostMessage(wizard.Handle, WM_KEYDOWN, new IntPtr((int)Keys.Enter), IntPtr.Zero);
});
// send the enter key to the wizard window
MW(() => Win32.PostMessage(wizard.Handle, WM_KEYDOWN, new IntPtr((int)Keys.Enter), IntPtr.Zero));
// wait for any progress dialog to close
while (MW(() => wizard.Visible && !wizard.CanFocus))
Thread.Sleep(1000);
MWWaitFor(() => wizard.Visible && wizard.CanFocus);
// 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]);
Assert.AreEqual(pageNames[i + 1], CurrentPageName(wizard),
string.Format("Enter key button didn't get from page {0} to page {1}", pageNames[i], pageNames[i + 1]));
}
else
{