Exemplo n.º 1
0
        public void TestAddMarkerData_ModifyMarker_01()
        {
            Accessor      ctlAccessor = ReflectionAccessor.Wrap(markerDataController);
            List <string> list        = (List <string>)ctlAccessor.GetField("m_otherMarkerNames");

            list.Clear();
            list.Add("makerName1");
            list.Add("makerName2");
            ctlAccessor.SetField("m_otherMarkerNames", list);

            //m_View.GetMarkerName() == ""
            TrendViewer.View.MarkerData frm = (TrendViewer.View.MarkerData)ctlAccessor.GetField("m_View");

            Accessor frmAccessor = ReflectionAccessor.Wrap(frm);
            TextBox  tb          = (TextBox)frmAccessor.GetField("markerNameBox");

            tb.Text = "";
            markerDataController.AddMarkerData(null, null);
            markerDataController.ModifyMarker(null, null);

            //m_View.GetMarkerName() != "", MarkerNameValid(markerName)
            tb.Text = "notEmptyName";
            markerDataController.AddMarkerData(null, null);
            markerDataController.ModifyMarker(null, null);

            //m_View.GetMarkerName() != "", !MarkerNameValid(markerName)
            tb.Text = "makerName1";
            markerDataController.AddMarkerData(null, null);
            markerDataController.ModifyMarker(null, null);
        }