コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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());
                }
            });
        }
コード例 #4
0
        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());
                }
            });
        }
コード例 #5
0
 private static AreaCVGraphData GetCurrentData(SummaryGraphPane pane)
 {
     return(GetPaneValue(pane, support => support.CurrentData));
 }
コード例 #6
0
 private static AreaCVGraphData.AreaCVGraphDataCache GetCache(SummaryGraphPane pane)
 {
     return(GetPaneValue(pane, support => support.Cache));
 }