Have regression testing return to the listbox window when a test has completed.

This commit is contained in:
Tim Young 2018-09-26 10:33:22 -05:00
parent aaf7afdd65
commit 73b11719b8
4 changed files with 36 additions and 9 deletions

View File

@ -57,6 +57,8 @@ namespace EduNetworkBuilder
string NoTestString = "No Test"; string NoTestString = "No Test";
string PassedString = "Passed"; string PassedString = "Passed";
string FailedString = "Failed;"; string FailedString = "Failed;";
public bool ClosingRegression = false;
/// <summary> /// <summary>
/// Instantiate a ListBoxWindow for use in choosing a network to load /// Instantiate a ListBoxWindow for use in choosing a network to load
@ -494,6 +496,7 @@ namespace EduNetworkBuilder
if (lbWindowData.SelectedItem != null) if (lbWindowData.SelectedItem != null)
NB.LoadNetworkFromResource(TheName); NB.LoadNetworkFromResource(TheName);
} }
Close();
} }
else if (MyMode == LBContents.regressiontest) else if (MyMode == LBContents.regressiontest)
{ {
@ -507,10 +510,13 @@ namespace EduNetworkBuilder
{ {
myWin.Activate(); myWin.Activate();
myWin.replayNetwork(TheName, 1); myWin.replayNetwork(TheName, 1);
//Return back to the listbox window
Visible = true;
Activate();
} }
} }
} }
Close(); else Close();
} }
/// <summary> /// <summary>
@ -622,6 +628,7 @@ namespace EduNetworkBuilder
//In regression, this is the close button //In regression, this is the close button
if (MyMode == LBContents.regressiontest) if (MyMode == LBContents.regressiontest)
{ {
ClosingRegression = true;
Close(); Close();
} }
} }

View File

@ -494,6 +494,7 @@ namespace EduNetworkBuilder
myWin.RegisterInvisibleNet(ToRegister); myWin.RegisterInvisibleNet(ToRegister);
} }
public static void UnregisterInvisibleNetwork() public static void UnregisterInvisibleNetwork()
{ {
BuilderWindow myWin = (BuilderWindow)Application.OpenForms["BuilderWindow"]; BuilderWindow myWin = (BuilderWindow)Application.OpenForms["BuilderWindow"];
@ -501,6 +502,13 @@ namespace EduNetworkBuilder
myWin.UnregisterInvisibleNet(); myWin.UnregisterInvisibleNet();
} }
public static bool ProcessingInvisibleNetwork()
{
BuilderWindow myWin = (BuilderWindow)Application.OpenForms["BuilderWindow"];
if (myWin == null) return false;
return myWin.ProcessingInvisibleNet();
}
/// <summary> /// <summary>
/// Make sure we update the visuals when we have the opportunity to do so /// Make sure we update the visuals when we have the opportunity to do so
/// </summary> /// </summary>

View File

@ -1214,13 +1214,21 @@ namespace EduNetworkBuilder
} }
} }
} }
answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo); //If we are processing an invisible replay, do not prompt...
if (!(NB.ProcessingInvisibleNetwork() && oursettings != null && oursettings.ReplayMode))
if (answer == DialogResult.Yes)
{ {
KillAllExtraWindows(true); answer = MessageBox.Show(NB.Translate("N_MarkAsSolvedDone"), NB.Translate("_Solved"), MessageBoxButtons.YesNo);
ListBoxWindow LBW = new ListBoxWindow();
LBW.ShowDialog(); if (answer == DialogResult.Yes)
{
KillAllExtraWindows(true);
ListBoxWindow LBW = new ListBoxWindow();
LBW.ShowDialog();
}
}
else
{
//We should go back to our replay window.
} }
} }
else else

View File

@ -2965,7 +2965,11 @@ namespace EduNetworkBuilder
private void regressionTestingToolStripMenuItem_Click(object sender, EventArgs e) private void regressionTestingToolStripMenuItem_Click(object sender, EventArgs e)
{ {
ListBoxWindow LBW = new ListBoxWindow(null, LBContents.regressiontest); ListBoxWindow LBW = new ListBoxWindow(null, LBContents.regressiontest);
LBW.ShowDialog(); //We want to show dialog, but it needs to go to the background. After that,
//It returns from the show dialog. So we need to loop continuously until
//It is completed.
while (!LBW.ClosingRegression)
LBW.ShowDialog();
} }
#endregion #endregion