Skip to content

Commit

Permalink
more debug output in Ms1FullScanFilteringTutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
bspratt committed Nov 7, 2024
1 parent e0ab70f commit dcc84da
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion pwiz_tools/Skyline/TestTutorial/Ms1FullScanFilteringTutorial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using pwiz.Common.SystemUtil;
Expand Down Expand Up @@ -131,6 +132,14 @@ private string PathsMessage(string message, IEnumerable<string> paths)
return TextUtil.LineSeparate(message, TextUtil.LineSeparate(paths));
}

// TODO revert this debug stuff if this ever merges to master
static void MFSTLog(string message,
[CallerFilePath] string file = null,
[CallerLineNumber] int line = 0)
{
Console.WriteLine(@"at {0} ({1}): {2}", Path.GetFileName(file), line, message);
}

protected override void DoTest()
{
// Clean-up before running the test
Expand Down Expand Up @@ -532,6 +541,7 @@ protected override void DoTest()

if (PreferWiff)
{
MFSTLog("PreferWiff");
RunUI(() =>
{
int pointCount = GetTotalPointCount(SkylineWindow.GraphFullScan.ZedGraphControl.GraphPane);
Expand All @@ -550,6 +560,7 @@ protected override void DoTest()
TestFullScanProperties();

RunUI(() => SkylineWindow.HideFullScanGraph());
MFSTLog("ArrangeGraphs");

RunUI(() =>
{
Expand Down Expand Up @@ -968,6 +979,7 @@ private string GetFileNameWithoutExtension(string searchFile)

private void TestFullScanProperties()
{
MFSTLog("TestFullScanProperties begin");
var expectedPropertiesDict = new Dictionary<string, object> {
{"FileName",PreferWiff ? "100803_0005b_MCF7_TiTip3.wiff" : "100803_0005b_MCF7_TiTip3.mzML"},
{"ReplicateName","5b_MCF7_TiTip3"},
Expand Down Expand Up @@ -1004,13 +1016,17 @@ private void TestFullScanProperties()

var propertiesButton = SkylineWindow.GraphFullScan.PropertyButton;
Assert.IsFalse(propertiesButton.Checked);
RunUI(() =>
MFSTLog("TestFullScanProperties");

RunUI(() =>
{
propertiesButton.PerformClick();
});
WaitForConditionUI(() => msGraph.PropertiesVisible);
MFSTLog("TestFullScanProperties");
WaitForGraphs();
MFSTLog("TestFullScanProperties");
FullScanProperties currentProperties = null;
RunUI(() =>
{
Expand All @@ -1027,8 +1043,11 @@ private void TestFullScanProperties()
{
SkylineWindow.GraphFullScan.LeftButton?.PerformClick();
});
MFSTLog("TestFullScanProperties");
WaitForGraphs();
MFSTLog("TestFullScanProperties");
WaitForConditionUI(() => SkylineWindow.GraphFullScan.IsLoaded);
MFSTLog("TestFullScanProperties");
RunUI(() =>
{
currentProperties = msGraph.PropertiesSheet.SelectedObject as FullScanProperties;
Expand All @@ -1040,9 +1059,13 @@ private void TestFullScanProperties()
propertiesButton.PerformClick();
});
MFSTLog("TestFullScanProperties");
WaitForConditionUI(() => !msGraph.PropertiesVisible);
MFSTLog("TestFullScanProperties");
WaitForGraphs();
MFSTLog("TestFullScanProperties");
Assert.IsFalse(propertiesButton.Checked);
MFSTLog("TestFullScanProperties done");

}
}
Expand Down

0 comments on commit dcc84da

Please sign in to comment.