private static AreaCVGraphData GetCurrentData(SummaryGraphPane pane) { var testSupport = pane as IAreaCVHistogramInfo; if (testSupport != null) { return(testSupport.CurrentData); } Assert.Fail("Graph pane is not a histogram/histogram2d graph pane"); return(null); }
private static TVal GetPaneValue <TVal>(SummaryGraphPane pane, Func <IAreaCVHistogramInfo, TVal> getValue) { var info = pane as IAreaCVHistogramInfo; if (info != null) { return(getValue(info)); } Assert.Fail("Graph pane is not a histogram/histogram2d graph pane"); return(default(TVal)); }
private void AssertDataCorrect(SummaryGraphPane pane, int statsIndex, bool record = true) { AreaCVGraphData data = null; WaitForConditionUI(() => (data = GetCurrentData(pane)) != null && data.IsValid); WaitForGraphs(); RunUI(() => { var testSupport = pane as IAreaCVHistogramInfo; int items = testSupport != null ? testSupport.Items : 0; var graphDataStatistics = new AreaCVGraphDataStatistics(data, items); if (!RecordData) { Assert.AreEqual(STATS[statsIndex], graphDataStatistics); } else if (record) { Console.WriteLine(graphDataStatistics.ToCode()); } }); }
private void AssertDataCorrect(SummaryGraphPane pane, int statsIndex) { AreaCVGraphData data = null; WaitForConditionUI(() => (data = GetCurrentData(pane)) != null); WaitForGraphs(); RunUI(() => { var info = pane as IAreaCVHistogramInfo; int items = info != null ? info.Items : 0; var graphDataStatistics = new AreaCVGraphDataStatistics(data, items); if (!RecordData) { Assert.AreEqual(STATS[statsIndex], new AreaCVGraphDataStatistics(data, items)); } else { Console.WriteLine(graphDataStatistics.ToCode()); } }); }
private static AreaCVGraphData GetCurrentData(SummaryGraphPane pane) { return(GetPaneValue(pane, support => support.CurrentData)); }
private static AreaCVGraphData.AreaCVGraphDataCache GetCache(SummaryGraphPane pane) { return(GetPaneValue(pane, support => support.Cache)); }