Get testall working. Yay!

This commit is contained in:
Tim Young 2018-09-28 08:20:48 -05:00
parent 03c9f3404a
commit 25cc1f720a
1 changed files with 43 additions and 2 deletions

View File

@ -643,10 +643,51 @@ namespace EduNetworkBuilder
//In regression, this is the test all button
if (MyMode == LBContents.regressiontest)
{
ClosingRegression = true;
Close();
//Loop through all the visible puzzles & process them in-order.
RegressionTestAll();
}
}
private void RegressionTestAll()
{
PuzzleInfo pi;
List<string> Puzzles = NB.GetPuzzleNames();
NBSettings oursettings = NB.GetSettings();
if (Puzzles == null) return;
foreach (string OnePuzzle in Puzzles)
{
pi = NB.GetPuzzleInfoFromName(OnePuzzle);
//shown_name = pi.PuzzleName;
List<string> tags = new List<string>(pi.PuzzleTags);
if (oursettings.HasReplay(OnePuzzle)) tags.Add(TestString);
else continue; //Do not try it if there is no replay
if (oursettings.HasPassed(OnePuzzle)) continue; //No need to test it again if it passed
if (oursettings.HasFailed(OnePuzzle)) tags.Add(FailedString);
if (!oursettings.HasFailed(OnePuzzle) && !oursettings.HasPassed(OnePuzzle)
&& oursettings.HasReplay(OnePuzzle))
tags.Add(Untested);
foreach (string tag in tags)
{
if (isChecked(tag))
{
//Visible = false;
BuilderWindow myWin = (BuilderWindow)Application.OpenForms["BuilderWindow"];
if (myWin != null)
{
//myWin.Activate();
myWin.replayNetwork(OnePuzzle, 1);
//Return back to the listbox window
Visible = true;
Activate();
}
break;
}
}
}
}
private void AddRoute()
{
NB_IPAddress newip = new NB_IPAddress(NB.ZeroIPString, NB.ZeroIPString, NB.ZeroIPString);