Beispiel #1
0
        public void TestgetETrendingChartType01()
        {
            string             displayName        = string.Empty;
            ETrendingChartType eTrendingChartType = TrendViewer.View.TrendViewerHelper.getETrendingChartType(displayName);

            TrendViewerHelper helper           = new TrendViewerHelper();
            Accessor          trendingHelperAc = ReflectionAccessor.Wrap(helper);

            displayName = (string)trendingHelperAc.GetField("FORMULA_PRE");

            eTrendingChartType = TrendViewerHelper.getETrendingChartType(displayName);

            displayName        = (string)trendingHelperAc.GetField("HIST_PRE");
            eTrendingChartType = TrendViewerHelper.getETrendingChartType(displayName);
        }
Beispiel #2
0
        public void TestgetDisplayName03()
        {
            ETrendingChartType trendingCType = ETrendingChartType.RealTime;
            string             inputName     = string.Empty;
            string             str           = TrendViewerHelper.getDisplayName(trendingCType, inputName);

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record(str);
            recorder.FinishRecording();
            #endregion
            #region Assertions
            Assert.AreEqual("", str);
            #endregion
        }
Beispiel #3
0
        const string HIST_PRE           = "H-"; // the prefix for historical type series name

        // return series name by the trending chart type(formula, historical, realtime) and the datapoint name.
        // it will be the inputname added by some prefix.
        public static string getDisplayName(ETrendingChartType trendingCType, string inputName)
        {
            string dispNmae;

            if (trendingCType == ETrendingChartType.Formula)   // for formula type
            {
                dispNmae = FORMULA_PRE + inputName;
                return(dispNmae);
            }
            else if (trendingCType == ETrendingChartType.Historical) // for historical type
            {
                dispNmae = HIST_PRE + inputName;
                return(dispNmae);
            }
            else                          // for real time type, currently we don't add any prefix to the name.
                                          // This is because we suppose the datapoint name will never be started with "H-" or "F-"
            {
                dispNmae = inputName;
                return(dispNmae);
            }
        }
Beispiel #4
0
 public void TestgetDisplayName01()
 {
     ETrendingChartType trendingCType = ETrendingChartType.Historical;
     string             inputName     = string.Empty;
     string             str           = TrendViewer.View.TrendViewerHelper.getDisplayName(trendingCType, inputName);
 }