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); }
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 }
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); } }
public void TestgetDisplayName01() { ETrendingChartType trendingCType = ETrendingChartType.Historical; string inputName = string.Empty; string str = TrendViewer.View.TrendViewerHelper.getDisplayName(trendingCType, inputName); }