Example #1
0
        public void TestOPCSampleGrpConfigStartConstructor02()
        {
            // for more than one process test

            //Test Procedure call
            OPCSampleGrpConfigStart oPCSampleGrpConfigStart = new OPCSampleGrpConfigStart();
        }
Example #2
0
        public void TestPopulateIntervalConfigDataGridView01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                IModel      model      = new OPCSampleGrpConfig.Model.OPCSampleGrpConfigStartModel();
                IController controller = new OPCSampleGrpConfig.Controller.OPCSampleGrpConfigStartController();
                oPCSampleGrpConfigStart.ViewType = OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM;
                controller.Attach(model, oPCSampleGrpConfigStart);
                Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                oPCSampleGrpConfigStartAccessor.Call("AttachListener", controller);
                oPCSampleGrpConfigStartAccessor.Call("InitializeIntervalConfigDataGridView");
                oPCSampleGrpConfigStartAccessor.Call("InitializeControlsCaptions");
                int mode = 1;
                //Test Procedure Call
                oPCSampleGrpConfigStart.PopulateIntervalConfigDataGridView(mode);

                //Post condition Check
                Assert.AreEqual(1, oPCSampleGrpConfigStartAccessor.GetFieldAccessor("pageNumIntervalConfigDataGridView").GetProperty("Value"));


                //Test 2
                mode = 2;
                oPCSampleGrpConfigStartAccessor.GetFieldAccessor("pageNumIntervalConfigDataGridView").SetProperty("Maximum", (Decimal)2);
                oPCSampleGrpConfigStartAccessor.GetFieldAccessor("pageNumIntervalConfigDataGridView").SetProperty("Value", (Decimal)2);

                //Test Procedure Call
                oPCSampleGrpConfigStart.PopulateIntervalConfigDataGridView(mode);

                //Post condition Check
                //Assert.AreEqual(2, oPCSampleGrpConfigStartAccessor.GetFieldAccessor("pageNumIntervalConfigDataGridView").GetProperty("Value"));
            }
        }
Example #3
0
        public void TestGetIntervalTypeString01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = (OPCSampleGrpConfigStart)ViewManager.GetInstance().GetView(OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM))
            {
                string   intervaltypeID = string.Empty;
                Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                string   str = (string)oPCSampleGrpConfigStartAccessor.Call("GetIntervalTypeString", intervaltypeID);
                //Post condition Check
                System.Windows.Forms.ComboBox intervaltype = (System.Windows.Forms.ComboBox)oPCSampleGrpConfigStartAccessor.GetField("intervalTypeBox");
                Assert.AreEqual(intervaltype.Items[OPCSampleGrpConfigStart.INTERVALETYPE_MINUTE_INDEX], str);

                intervaltypeID = DAO.Trending.Helper.DAOHelper.MINITE;
                str            = (string)oPCSampleGrpConfigStartAccessor.Call("GetIntervalTypeString", intervaltypeID);
                //Post condition Check
                Assert.AreEqual(intervaltype.Items[OPCSampleGrpConfigStart.INTERVALETYPE_MINUTE_INDEX], str);

                intervaltypeID = DAO.Trending.Helper.DAOHelper.HOUR;
                str            = (string)oPCSampleGrpConfigStartAccessor.Call("GetIntervalTypeString", intervaltypeID);
                //Post condition Check
                Assert.AreEqual(intervaltype.Items[OPCSampleGrpConfigStart.INTERVALETYPE_HOUR_INDEX], str);

                intervaltypeID = DAO.Trending.Helper.DAOHelper.SECOND;
                str            = (string)oPCSampleGrpConfigStartAccessor.Call("GetIntervalTypeString", intervaltypeID);
                //Post condition Check
                Assert.AreEqual(intervaltype.Items[OPCSampleGrpConfigStart.INTERVALETYPE_SECOND_INDEX], str);
            }
        }
Example #4
0
        public void TestAttachListener01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                using (IController ctl = OPCSampleGrpConfigStartControllerFactory.CreateOPCSampleGrpConfigStartController01())
                {
                    //Test 1 ---   testing for valid connection string
                    //Test Procedure call
                    OPCSampleGrpConfig.Model.OPCSampleGrpConfigStartModel model = OPCSampleGrpConfig.DotTest.Factories.Model.OPCSampleGrpConfigStartModelFactory.CreateOPCSampleGrpConfigStartModel01();
                    Accessor controllerAccessor = ReflectionAccessor.Wrap(ctl);
                    controllerAccessor.Call("Attach", model, oPCSampleGrpConfigStart);
                    oPCSampleGrpConfigStart.AttachListener(ctl);

                    #region PostConditionCheck
                    //Post Condition Check
                    //Assert.AreNotEqual((int)DAO.Trending.Helper.LocationKeyHelper.GetInstance().LocationKey, 0);
                    #endregion

                    //Test 2 --- testing for invalid connection string
                    DAO.Trending.Common.DBConnectionStrings.ReleaseInstance();
                    oPCSampleGrpConfigStart.AttachListener(ctl);

                    DAO.Trending.Common.DBConnectionStrings.GetInstance().AddConnectionString(TrendingHelper.ConfigureFileHelper.GetInstance().ConnectionStringConfig);
                }
            }
        }
Example #5
0
        public void TestInitializeIntervalConfigDataGridView02()
        {
            //testing for Chinese Language
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                //Test Procedure Call
                LanguageTypeHelper.GetInstance().SetLanaguageType(LanguageType.Chinese);
                Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                oPCSampleGrpConfigStartAccessor.Call("InitializeIntervalConfigDataGridView");

                #region PostConditionCheck
                //Post Condition Check
                Accessor opcStartaccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                System.Windows.Forms.DataGridView gridCtrl = (System.Windows.Forms.DataGridView)opcStartaccessor.GetField("intervalConfigDataGridView");
                //Column count
                Assert.AreEqual(12, gridCtrl.ColumnCount);
                //column names
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEGRPID_COL_NAME, gridCtrl.Columns[0].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEGRPNAME_COL_NAME, gridCtrl.Columns[1].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEGRPDESC_COL_NAME, gridCtrl.Columns[2].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEINTERVAL_COL_NAME, gridCtrl.Columns[3].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEINTERVALTYPE_COL_NAME, gridCtrl.Columns[4].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLESTARTTIME_COL_NAME, gridCtrl.Columns[5].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEDELTAVAL_COL_NAME, gridCtrl.Columns[6].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLELOCATION_COL_NAME, gridCtrl.Columns[7].Name);
                Assert.AreEqual("", gridCtrl.Columns[8].Name);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_EDITCOLUMN_NAME, gridCtrl.Columns[9].Name);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_DELETECOL_NAME, gridCtrl.Columns[10].Name);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_CONFIGCOL_NAME, gridCtrl.Columns[11].Name);
                //column header English text
                Assert.AreEqual(opcStartaccessor.GetField("OPCSAMPLEGRPID_COL_TEXT"), gridCtrl.Columns[0].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.DATA_GROUP_NAME, gridCtrl.Columns[1].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.DESCRIPTION, gridCtrl.Columns[2].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.COLUMN_TIME_SPAN, gridCtrl.Columns[3].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.COLUMN_TIME_FRAME, gridCtrl.Columns[4].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.COLUMN_START_TIME, gridCtrl.Columns[5].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.COLUMN_DELTA_VALUE, gridCtrl.Columns[6].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.COLUMN_LOCATION, gridCtrl.Columns[7].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.DISABLE, gridCtrl.Columns[8].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.COLUMN_EDIT, gridCtrl.Columns[9].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.COLUMN_DELETE, gridCtrl.Columns[10].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.COLUMN_CONFIG, gridCtrl.Columns[11].HeaderText);
                //column width
                Assert.AreEqual(50, gridCtrl.Columns[0].Width);
                Assert.AreEqual(250, gridCtrl.Columns[1].Width);
                Assert.AreEqual(220, gridCtrl.Columns[2].Width);
                Assert.AreEqual(60, gridCtrl.Columns[3].Width);
                Assert.AreEqual(95, gridCtrl.Columns[4].Width);
                Assert.AreEqual(80, gridCtrl.Columns[5].Width);
                Assert.AreEqual(92, gridCtrl.Columns[6].Width);
                Assert.AreEqual(80, gridCtrl.Columns[7].Width);
                Assert.AreEqual(70, gridCtrl.Columns[8].Width);
                Assert.AreEqual(50, gridCtrl.Columns[9].Width);
                Assert.AreEqual(50, gridCtrl.Columns[10].Width);
                Assert.AreEqual(50, gridCtrl.Columns[11].Width);
                LanguageTypeHelper.GetInstance().SetLanaguageType(LanguageType.English);
                #endregion
            }
        }
Example #6
0
 public void TestInitializeComponent01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
     {
         Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
         oPCSampleGrpConfigStartAccessor.Call("InitializeComponent");
     }
 }
Example #7
0
 public void TestcancelMsgCmd_Click01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = (OPCSampleGrpConfigStart)ViewManager.GetInstance().GetView(OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM))
     {
         Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
         oPCSampleGrpConfigStartAccessor.Call("cancelMsgCmd_Click", null, null);
     }
 }
Example #8
0
 public void TestlastIntervalConfigDataGridView_Click01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
     {
         Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
         oPCSampleGrpConfigStartAccessor.Call("lastIntervalConfigDataGridView_Click", null, null);
     }
 }
Example #9
0
        public void TestInitializeIntervalConfigDataGridView01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                DAO.Trending.Helper.LocationKeyHelper.GetInstance().init();
                Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                oPCSampleGrpConfigStartAccessor.Call("InitializeIntervalConfigDataGridView");


                #region PostConditionCheck
                //Post Condition Check
                Accessor opcStartaccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                System.Windows.Forms.DataGridView gridCtrl = (System.Windows.Forms.DataGridView)opcStartaccessor.GetField("intervalConfigDataGridView");
                //Column count
                Assert.AreEqual(12, gridCtrl.ColumnCount);
                //column names
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEGRPID_COL_NAME, gridCtrl.Columns[0].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEGRPNAME_COL_NAME, gridCtrl.Columns[1].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEGRPDESC_COL_NAME, gridCtrl.Columns[2].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEINTERVAL_COL_NAME, gridCtrl.Columns[3].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEINTERVALTYPE_COL_NAME, gridCtrl.Columns[4].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLESTARTTIME_COL_NAME, gridCtrl.Columns[5].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLEDELTAVAL_COL_NAME, gridCtrl.Columns[6].Name);
                Assert.AreEqual(OPCSampleGrpConfigStart.OPCSAMPLELOCATION_COL_NAME, gridCtrl.Columns[7].Name);
                Assert.AreEqual("", gridCtrl.Columns[8].Name);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_EDITCOLUMN_NAME, gridCtrl.Columns[9].Name);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_DELETECOL_NAME, gridCtrl.Columns[10].Name);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_CONFIGCOL_NAME, gridCtrl.Columns[11].Name);
                //column header English text
                Assert.AreEqual(opcStartaccessor.GetField("OPCSAMPLEGRPID_COL_TEXT"), gridCtrl.Columns[0].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRPNAME_COL_TEXT, gridCtrl.Columns[1].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRPDESC_COL_TEXT, gridCtrl.Columns[2].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEINTERVAL_COL_TEXT, gridCtrl.Columns[3].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEINTERVALTYPE_COL_TEXT, gridCtrl.Columns[4].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLESTARTTIME_COL_TEXT, gridCtrl.Columns[5].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEDELTAVAL_COL_TEXT, gridCtrl.Columns[6].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_LOCATIONCOL_NAME, gridCtrl.Columns[7].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEDISABLE_COL_TEXT, gridCtrl.Columns[8].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_EDITCOLUMN_NAME, gridCtrl.Columns[9].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_DELETECOL_NAME, gridCtrl.Columns[10].HeaderText);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.OPCSAMPLEGRP_CONFIGCOL_NAME, gridCtrl.Columns[11].HeaderText);
                //column width
                Assert.AreEqual(50, gridCtrl.Columns[0].Width);
                Assert.AreEqual(250, gridCtrl.Columns[1].Width);
                Assert.AreEqual(220, gridCtrl.Columns[2].Width);
                Assert.AreEqual(60, gridCtrl.Columns[3].Width);
                Assert.AreEqual(95, gridCtrl.Columns[4].Width);
                Assert.AreEqual(80, gridCtrl.Columns[5].Width);
                Assert.AreEqual(92, gridCtrl.Columns[6].Width);
                Assert.AreEqual(80, gridCtrl.Columns[7].Width);
                Assert.AreEqual(70, gridCtrl.Columns[8].Width);
                Assert.AreEqual(50, gridCtrl.Columns[9].Width);
                Assert.AreEqual(50, gridCtrl.Columns[10].Width);
                Assert.AreEqual(50, gridCtrl.Columns[11].Width);
                #endregion
            }
        }
Example #10
0
        public void TestOPCSampleGrpConfigStartConstructor01()
        {
            OPCSampleGrpConfigStart oPCSampleGrpConfigStart = new OPCSampleGrpConfigStart();

            //Post condition check
            Accessor opcStartaccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);

            Assert.IsNotEmpty((string)opcStartaccessor.GetField("m_localConnectionString"));
        }
Example #11
0
 public void TestGetDataGridValue01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
     {
         int    nRow    = 0;
         int    nColumn = int.MinValue;
         string str     = oPCSampleGrpConfigStart.GetDataGridValue(nRow, nColumn);
     }
 }
Example #12
0
        public void TestTranslateCaption01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                //Test 1 ---   testing for english language setting
                //Test Procedure call
                oPCSampleGrpConfigStart.TranslateCaption();

                #region PostConditionCheck
                //Post Condition Check
                Accessor opcStartaccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.DP_GRP_NAME, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label1")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.DP_GRP_DES, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label2")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.START_TIME, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label3")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.DELTA_VALUE, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label4")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.INTERVAL_UNIT, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label6")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.INTERVAL_LENGTH, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label7")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.DISABLE, ((System.Windows.Forms.CheckBox)opcStartaccessor.GetField("disableCheckBox")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.CANCLE, ((System.Windows.Forms.Button)opcStartaccessor.GetField("cancelMsgCmd")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.SAVE, ((System.Windows.Forms.Button)opcStartaccessor.GetField("saveMsgCmd")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.TOTAL_PAGE, ((System.Windows.Forms.ToolStripLabel)opcStartaccessor.GetField("TotalPage_Tlbl")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.TITLE, oPCSampleGrpConfigStart.Text);
                System.Windows.Forms.ComboBox intervalCombo = (System.Windows.Forms.ComboBox)opcStartaccessor.GetField("intervalTypeBox");
                Assert.AreEqual(3, intervalCombo.Items.Count);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.HOUR, intervalCombo.Items[OPCSampleGrpConfigStart.INTERVALETYPE_HOUR_INDEX]);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.MINITE, intervalCombo.Items[OPCSampleGrpConfigStart.INTERVALETYPE_MINUTE_INDEX]);
                Assert.AreEqual(OPCSampleGrpConfig.Common.EnglishString.SECOND, intervalCombo.Items[OPCSampleGrpConfigStart.INTERVALETYPE_SECOND_INDEX]);
                #endregion

                //Test2 --- testing chinese language settings.

                LanguageTypeHelper.GetInstance().SetLanaguageType(LanguageType.Chinese);
                oPCSampleGrpConfigStart.TranslateCaption();

                #region PostConditionCheck
                //Post Condition Check
                opcStartaccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.DP_GRP_NAME, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label1")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.DP_GRP_DES, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label2")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.START_TIME, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label3")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.DELTA_VALUE, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label4")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.INTERVAL_UNIT, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label6")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.INTERVAL_LENGTH, ((System.Windows.Forms.Label)opcStartaccessor.GetField("label7")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.DISABLE, ((System.Windows.Forms.CheckBox)opcStartaccessor.GetField("disableCheckBox")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.CANCLE, ((System.Windows.Forms.Button)opcStartaccessor.GetField("cancelMsgCmd")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.SAVE, ((System.Windows.Forms.Button)opcStartaccessor.GetField("saveMsgCmd")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.TOTAL_PAGE, ((System.Windows.Forms.ToolStripLabel)opcStartaccessor.GetField("TotalPage_Tlbl")).Text);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.TITLE, oPCSampleGrpConfigStart.Text);
                intervalCombo = (System.Windows.Forms.ComboBox)opcStartaccessor.GetField("intervalTypeBox");
                Assert.AreEqual(3, intervalCombo.Items.Count);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.HOUR, intervalCombo.Items[OPCSampleGrpConfigStart.INTERVALETYPE_HOUR_INDEX]);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.MINITE, intervalCombo.Items[OPCSampleGrpConfigStart.INTERVALETYPE_MINUTE_INDEX]);
                Assert.AreEqual(OPCSampleGrpConfig.Common.ChineseString.SECOND, intervalCombo.Items[OPCSampleGrpConfigStart.INTERVALETYPE_SECOND_INDEX]);
                LanguageTypeHelper.GetInstance().SetLanaguageType(LanguageType.English);
                #endregion
            }
        }
Example #13
0
 public void TestDispose01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
     {
         bool     disposing = true;
         Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
         oPCSampleGrpConfigStartAccessor.SetField("components", new System.ComponentModel.Container());
         oPCSampleGrpConfigStartAccessor.Call("Dispose", disposing);
     }
 }
Example #14
0
        public void TestTotalNumberGrpSetter01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                int totalNumberGrp = int.MinValue;
                oPCSampleGrpConfigStart.TotalNumberGrp = totalNumberGrp;


                //Post Condition Check
                Accessor opcStartaccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);

                Assert.AreEqual(totalNumberGrp, opcStartaccessor.GetProperty("TotalNumberGrp"));
            }
        }
Example #15
0
 public void TestpageNumIntervalConfigDataGridView_ValueChanged01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
     {
         IModel      model      = new OPCSampleGrpConfig.Model.OPCSampleGrpConfigStartModel();
         IController controller = new OPCSampleGrpConfig.Controller.OPCSampleGrpConfigStartController();
         oPCSampleGrpConfigStart.ViewType = OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM;
         controller.Attach(model, oPCSampleGrpConfigStart);
         Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
         oPCSampleGrpConfigStartAccessor.Call("AttachListener", controller);
         oPCSampleGrpConfigStartAccessor.Call("InitializeControlsCaptions");
         oPCSampleGrpConfigStartAccessor.Call("InitializeIntervalConfigDataGridView");
         oPCSampleGrpConfigStartAccessor.Call("pageNumIntervalConfigDataGridView_ValueChanged", null, null);
     }
 }
Example #16
0
 public void TestnextIntervalConfigDataGridView_Click01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
     {
         IModel      model      = new OPCSampleGrpConfig.Model.OPCSampleGrpConfigStartModel();
         IController controller = new OPCSampleGrpConfig.Controller.OPCSampleGrpConfigStartController();
         oPCSampleGrpConfigStart.ViewType = OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM;
         controller.Attach(model, oPCSampleGrpConfigStart);
         Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
         oPCSampleGrpConfigStartAccessor.Call("AttachListener", controller);
         oPCSampleGrpConfigStartAccessor.Call("InitializeIntervalConfigDataGridView");
         oPCSampleGrpConfigStartAccessor.Call("InitializeControlsCaptions");
         oPCSampleGrpConfigStartAccessor.GetFieldAccessor("pageNumIntervalConfigDataGridView").SetProperty("Maximum", (decimal)3);
         oPCSampleGrpConfigStartAccessor.Call("nextIntervalConfigDataGridView_Click", null, null);
     }
 }
Example #17
0
        public void TestResetEditFields01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                oPCSampleGrpConfigStart.ResetEditFields();

                //Post condition Check
                Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                Assert.AreEqual("", oPCSampleGrpConfigStartAccessor.GetProperty("intervalNameTextBox.Text"));
                Assert.AreEqual("", oPCSampleGrpConfigStartAccessor.GetProperty("intervalDescTextBox.Text"));
                Assert.AreEqual(1, oPCSampleGrpConfigStartAccessor.GetProperty(" intervalUnitBox.Value"));
                Assert.AreEqual(OPCSampleGrpConfigStart.INTERVALETYPE_MINUTE_INDEX, oPCSampleGrpConfigStartAccessor.GetProperty("intervalTypeBox.SelectedIndex"));
                Assert.AreEqual(1, oPCSampleGrpConfigStartAccessor.GetProperty("deltaValueBox.Value"));
                Assert.AreEqual(false, oPCSampleGrpConfigStartAccessor.GetProperty("dateTimePicker.Checked"));
                Assert.AreEqual(true, oPCSampleGrpConfigStartAccessor.GetProperty("disableCheckBox.Checked"));
                Assert.AreEqual(false, oPCSampleGrpConfigStartAccessor.GetProperty("intervalNameTextBox.Enabled"));
            }
        }
Example #18
0
        public void TestAddLoggerInterval_Load01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                //Test1 = Exception thrown
                IModel      model      = new OPCSampleGrpConfig.Model.OPCSampleGrpConfigStartModel();
                IController controller = new OPCSampleGrpConfig.Controller.OPCSampleGrpConfigStartController();
                oPCSampleGrpConfigStart.ViewType = OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM;
                controller.Attach(model, oPCSampleGrpConfigStart);
                Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                oPCSampleGrpConfigStartAccessor.Call("AttachListener", controller);
                //Test Procedure Call
                oPCSampleGrpConfigStartAccessor.Call("AddLoggerInterval_Load", null, null);

                //test2
                oPCSampleGrpConfigStart.TranslateCaption();
                //Test Procedure Call
                oPCSampleGrpConfigStartAccessor.Call("AddLoggerInterval_Load", null, null);
            }
        }
Example #19
0
        public void TestSetEditFields01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                //Test1 = Exception thrown
                IModel      model      = new OPCSampleGrpConfig.Model.OPCSampleGrpConfigStartModel();
                IController controller = new OPCSampleGrpConfig.Controller.OPCSampleGrpConfigStartController();
                oPCSampleGrpConfigStart.ViewType = OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM;
                controller.Attach(model, oPCSampleGrpConfigStart);
                Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                oPCSampleGrpConfigStartAccessor.Call("AttachListener", controller);
                EtyDataLogDPGroupTrend ety = new EtyDataLogDPGroupTrend();
                ety.Disabled   = true;
                ety.StartTime  = "10:30";
                ety.DeltaValue = 1;
                //Test Procedure Call
                oPCSampleGrpConfigStartAccessor.Call("SetEditFields", ety);


                //Test2
                oPCSampleGrpConfigStart.TranslateCaption();
                oPCSampleGrpConfigStartAccessor.Call("SetEditFields", ety);
            }
        }
Example #20
0
 public void TestCreateOPCSampleGrpConfigStart01()
 {
     using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = CreateOPCSampleGrpConfigStart01())
     {
         Assert.IsNotNull(oPCSampleGrpConfigStart);
         #region Record State
         ValueRecorder recorder = new ValueRecorder();
         recorder.Record((string)oPCSampleGrpConfigStart.AccessibleDefaultActionDescription);
         recorder.Record((string)oPCSampleGrpConfigStart.AccessibleDescription);
         recorder.Record((string)oPCSampleGrpConfigStart.AccessibleName);
         recorder.Record((AccessibleRole)oPCSampleGrpConfigStart.AccessibleRole);
         recorder.Record((bool)oPCSampleGrpConfigStart.AllowDrop);
         recorder.Record((bool)oPCSampleGrpConfigStart.AllowTransparency);
         recorder.Record((AnchorStyles)oPCSampleGrpConfigStart.Anchor);
         recorder.Record((AutoScaleMode)oPCSampleGrpConfigStart.AutoScaleMode);
         recorder.Record((bool)oPCSampleGrpConfigStart.AutoScroll);
         recorder.Record((bool)oPCSampleGrpConfigStart.AutoSize);
         recorder.Record((AutoSizeMode)oPCSampleGrpConfigStart.AutoSizeMode);
         recorder.Record((AutoValidate)oPCSampleGrpConfigStart.AutoValidate);
         recorder.Record((ImageLayout)oPCSampleGrpConfigStart.BackgroundImageLayout);
         recorder.Record((int)oPCSampleGrpConfigStart.Bottom);
         recorder.Record((bool)oPCSampleGrpConfigStart.CanFocus);
         recorder.Record((bool)oPCSampleGrpConfigStart.CanSelect);
         recorder.Record((bool)oPCSampleGrpConfigStart.Capture);
         recorder.Record((bool)oPCSampleGrpConfigStart.CausesValidation);
         recorder.Record((string)oPCSampleGrpConfigStart.CompanyName);
         recorder.Record((bool)oPCSampleGrpConfigStart.ContainsFocus);
         recorder.Record((bool)oPCSampleGrpConfigStart.ControlBox);
         recorder.Record((bool)oPCSampleGrpConfigStart.Created);
         recorder.Record((DialogResult)oPCSampleGrpConfigStart.DialogResult);
         recorder.Record((bool)oPCSampleGrpConfigStart.Disposing);
         recorder.Record((DockStyle)oPCSampleGrpConfigStart.Dock);
         recorder.Record((bool)oPCSampleGrpConfigStart.Enabled);
         recorder.Record((bool)oPCSampleGrpConfigStart.Focused);
         recorder.Record((FormBorderStyle)oPCSampleGrpConfigStart.FormBorderStyle);
         recorder.Record((bool)oPCSampleGrpConfigStart.HasChildren);
         recorder.Record((int)oPCSampleGrpConfigStart.Height);
         recorder.Record((bool)oPCSampleGrpConfigStart.HelpButton);
         recorder.Record((ImeMode)oPCSampleGrpConfigStart.ImeMode);
         recorder.Record((bool)oPCSampleGrpConfigStart.InvokeRequired);
         recorder.Record((bool)oPCSampleGrpConfigStart.IsAccessible);
         recorder.Record((bool)oPCSampleGrpConfigStart.IsDisposed);
         recorder.Record((bool)oPCSampleGrpConfigStart.IsHandleCreated);
         recorder.Record((bool)oPCSampleGrpConfigStart.IsMdiChild);
         recorder.Record((bool)oPCSampleGrpConfigStart.IsMdiContainer);
         recorder.Record((bool)oPCSampleGrpConfigStart.IsMirrored);
         recorder.Record((bool)oPCSampleGrpConfigStart.IsRestrictedWindow);
         recorder.Record((bool)oPCSampleGrpConfigStart.KeyPreview);
         recorder.Record((int)oPCSampleGrpConfigStart.Left);
         recorder.Record((bool)oPCSampleGrpConfigStart.MaximizeBox);
         recorder.Record((bool)oPCSampleGrpConfigStart.MinimizeBox);
         recorder.Record((bool)oPCSampleGrpConfigStart.Modal);
         recorder.Record((string)oPCSampleGrpConfigStart.Name);
         recorder.Record((double)oPCSampleGrpConfigStart.Opacity);
         recorder.Record((string)oPCSampleGrpConfigStart.ProductName);
         recorder.Record((string)oPCSampleGrpConfigStart.ProductVersion);
         recorder.Record((bool)oPCSampleGrpConfigStart.RecreatingHandle);
         recorder.Record((int)oPCSampleGrpConfigStart.Right);
         recorder.Record((RightToLeft)oPCSampleGrpConfigStart.RightToLeft);
         recorder.Record((bool)oPCSampleGrpConfigStart.RightToLeftLayout);
         recorder.Record((bool)oPCSampleGrpConfigStart.ShowIcon);
         recorder.Record((bool)oPCSampleGrpConfigStart.ShowInTaskbar);
         recorder.Record((SizeGripStyle)oPCSampleGrpConfigStart.SizeGripStyle);
         recorder.Record((FormStartPosition)oPCSampleGrpConfigStart.StartPosition);
         recorder.Record((bool)ReflectionAccessor.Wrap(oPCSampleGrpConfigStart).GetProperty("System.Windows.Forms.Layout.IArrangedElement.ParticipatesInLayout"));
         recorder.Record((int)oPCSampleGrpConfigStart.TabIndex);
         recorder.Record((bool)oPCSampleGrpConfigStart.TabStop);
         recorder.Record((string)oPCSampleGrpConfigStart.Text);
         recorder.Record((int)oPCSampleGrpConfigStart.Top);
         recorder.Record((bool)oPCSampleGrpConfigStart.TopLevel);
         recorder.Record((bool)oPCSampleGrpConfigStart.TopMost);
         recorder.Record((bool)oPCSampleGrpConfigStart.UseWaitCursor);
         recorder.Record((string)oPCSampleGrpConfigStart.ViewID);
         recorder.Record((string)oPCSampleGrpConfigStart.ViewType);
         recorder.Record((bool)oPCSampleGrpConfigStart.Visible);
         recorder.Record((int)oPCSampleGrpConfigStart.Width);
         recorder.Record((FormWindowState)oPCSampleGrpConfigStart.WindowState);
         recorder.FinishRecording();
         #endregion
         #region Assertions
         Assert.IsNull((string)oPCSampleGrpConfigStart.AccessibleDefaultActionDescription);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.AllowDrop);
         Assert.AreEqual(global::System.Windows.Forms.AutoScaleMode.Font, (AutoScaleMode)oPCSampleGrpConfigStart.AutoScaleMode);
         Assert.AreEqual(global::System.Windows.Forms.AutoValidate.EnablePreventFocusChange, (AutoValidate)oPCSampleGrpConfigStart.AutoValidate);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.CanFocus);
         Assert.AreEqual("ST Electronics Ltd", (string)oPCSampleGrpConfigStart.CompanyName);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.Created);
         Assert.IsTrue((bool)oPCSampleGrpConfigStart.Enabled);
         Assert.IsTrue((bool)oPCSampleGrpConfigStart.HasChildren);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.InvokeRequired);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.IsHandleCreated);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.IsRestrictedWindow);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.MaximizeBox);
         Assert.AreEqual(1.0, (double)oPCSampleGrpConfigStart.Opacity, 1E-7);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.RecreatingHandle);
         Assert.IsTrue((bool)oPCSampleGrpConfigStart.ShowIcon);
         Assert.AreEqual(global::System.Windows.Forms.FormStartPosition.CenterParent, (FormStartPosition)oPCSampleGrpConfigStart.StartPosition);
         Assert.AreEqual("OPC DataLogger Configuration", (string)oPCSampleGrpConfigStart.Text);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.TopMost);
         Assert.IsFalse((bool)oPCSampleGrpConfigStart.Visible);
         #endregion
     }
 }
Example #21
0
        public static OPCSampleGrpConfigStart CreateOPCSampleGrpConfigStart01()
        {
            OPCSampleGrpConfigStart oPCSampleGrpConfigStart = new OPCSampleGrpConfigStart();

            return(oPCSampleGrpConfigStart);
        }
 /// <summary>
 ///  Callback function which links controller with its view and model classes.
 /// </summary>
 /// <param name="model"></param>
 /// <param name="view"></param>
 public override void AttachCallBack(IModel model, IView view)
 {
     m_model = (OPCSampleGrpConfigStartModel)model;
     m_view  = (OPCSampleGrpConfigStart)view;
 }
Example #23
0
        public void TestLoadPageNumber01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = (OPCSampleGrpConfigStart)ViewManager.GetInstance().GetView(OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM))
            {
                Accessor    oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                IModel      model      = new OPCSampleGrpConfig.Model.OPCSampleGrpConfigStartModel();
                IController controller = new OPCSampleGrpConfig.Controller.OPCSampleGrpConfigStartController();
                oPCSampleGrpConfigStart.ViewType = OPCSampleGrpConfigStart.OPCSAMPLEGRPCONFIGSTARTFRM;
                controller.Attach(model, oPCSampleGrpConfigStart);
                oPCSampleGrpConfigStartAccessor.Call("AttachListener", controller);
                oPCSampleGrpConfigStartAccessor.Call("InitializeIntervalConfigDataGridView");
                oPCSampleGrpConfigStartAccessor.Call("InitializeIntervalConfigDataGridView");
                oPCSampleGrpConfigStartAccessor.SetField("m_totalGrpCount", (int)10);
                oPCSampleGrpConfigStartAccessor.SetField("m_upperIndex", (int)10);
                oPCSampleGrpConfigStartAccessor.SetField("m_lowerIndex", (int)0);
                //System.Collections.Generic.List<EtyOPCSampleGroup> OPCSampleGrpList = DAO.Trending.OPCSampleGroupDAO.GetInstance().GetAllOPCGrpsByPage(0, 10);
                System.Collections.Generic.List <EtyDataLogDPGroupTrend> OPCSampleGrpList = new System.Collections.Generic.List <EtyDataLogDPGroupTrend>();
                EtyDataLogDPGroupTrend e1 = new EtyDataLogDPGroupTrend();
                EtyDataLogDPGroupTrend e2 = new EtyDataLogDPGroupTrend();
                EtyDataLogDPGroupTrend e3 = new EtyDataLogDPGroupTrend();
                EtyDataLogDPGroupTrend e4 = new EtyDataLogDPGroupTrend();
                EtyDataLogDPGroupTrend e5 = new EtyDataLogDPGroupTrend();
                EtyDataLogDPGroupTrend e6 = new EtyDataLogDPGroupTrend();
                EtyDataLogDPGroupTrend e7 = new EtyDataLogDPGroupTrend();
                EtyDataLogDPGroupTrend e8 = new EtyDataLogDPGroupTrend();
                EtyDataLogDPGroupTrend e9 = new EtyDataLogDPGroupTrend();
                e9.Disabled = true;
                EtyDataLogDPGroupTrend e10 = new EtyDataLogDPGroupTrend();

                OPCSampleGrpList.Add(e1);
                OPCSampleGrpList.Add(e2);
                OPCSampleGrpList.Add(e3);
                OPCSampleGrpList.Add(e4);
                OPCSampleGrpList.Add(e5);
                OPCSampleGrpList.Add(e6);
                OPCSampleGrpList.Add(e7);
                OPCSampleGrpList.Add(e8);
                OPCSampleGrpList.Add(e9);
                OPCSampleGrpList.Add(e10);

                oPCSampleGrpConfigStartAccessor.Call("LoadGridData", OPCSampleGrpList);


                //Test Procedure Call
                oPCSampleGrpConfigStartAccessor.Call("LoadPageNumber");
                //Post condition Check
                int totalRec = (int)oPCSampleGrpConfigStartAccessor.GetField("m_totalGrpCount");
                System.Windows.Forms.ToolStripLabel totalPgeNum = (System.Windows.Forms.ToolStripLabel)oPCSampleGrpConfigStartAccessor.GetField("totalIntervalConfigDataGridView");
                int TotalPageNumber = 1;
                TotalPageNumber = totalRec / 8;
                if (totalRec % 8 != 0)
                {
                    TotalPageNumber++;
                }
                System.Windows.Forms.NumericUpDown PageUpdm = (System.Windows.Forms.NumericUpDown)oPCSampleGrpConfigStartAccessor.GetField("pageNumIntervalConfigDataGridView");
                //System.Windows.Forms.DataGridView intervalDataGrid = (System.Windows.Forms.DataGridView)oPCSampleGrpConfigStartAccessor.GetField("intervalConfigDataGridView");
                Assert.AreEqual(TotalPageNumber.ToString(), totalPgeNum.Text);
                Assert.AreEqual(TotalPageNumber, PageUpdm.Maximum);

                //test2
                oPCSampleGrpConfigStartAccessor.SetField("m_totalGrpCount", (int)8);
                //Test Procedure Call
                oPCSampleGrpConfigStartAccessor.Call("LoadPageNumber");

                //test3
                oPCSampleGrpConfigStartAccessor.SetField("m_totalGrpCount", (int)0);
                //Test Procedure Call
                oPCSampleGrpConfigStartAccessor.Call("LoadPageNumber");
            }
        }
Example #24
0
        public void TestGetEditFields01()
        {
            using (OPCSampleGrpConfigStart oPCSampleGrpConfigStart = OPCSampleGrpConfigStartFactory.CreateOPCSampleGrpConfigStart01())
            {
                // with intervalTestName = NULL
                Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStart);
                //Test Procedure Call
                EtyDataLogDPGroupTrend etyOPCSampleGroup = oPCSampleGrpConfigStart.GetEditFields();
                #region PostCheck
                //Post Condition check
                Assert.IsNull(etyOPCSampleGroup);
                #endregion

                //Test2 -Proper execution
                oPCSampleGrpConfigStartAccessor.GetFieldAccessor("intervalNameTextBox").SetProperty("Text", "ParasoftTesting");
                //Test Procedure Call
                etyOPCSampleGroup = oPCSampleGrpConfigStart.GetEditFields();
                #region PostCheck
                //Post Condition check
                Assert.AreEqual(((String)oPCSampleGrpConfigStartAccessor.GetFieldAccessor("intervalNameTextBox").GetProperty("Text")).ToString().Trim(), etyOPCSampleGroup.SampleGrpName);
                Assert.AreEqual(oPCSampleGrpConfigStartAccessor.GetFieldAccessor("intervalDescTextBox").GetProperty("Text"), etyOPCSampleGroup.SampleGrpDescription);
                Assert.AreEqual(oPCSampleGrpConfigStartAccessor.GetFieldAccessor("intervalUnitBox").GetProperty("Value"), etyOPCSampleGroup.Interval);
                string intervalTypestr = DAO.Trending.Helper.DAOHelper.MINITE;
                Assert.AreEqual(intervalTypestr, etyOPCSampleGroup.IntervalType);
                Assert.AreEqual(oPCSampleGrpConfigStartAccessor.GetFieldAccessor("disableCheckBox").GetProperty("Checked"), etyOPCSampleGroup.Disabled);
                Assert.AreEqual(oPCSampleGrpConfigStartAccessor.GetFieldAccessor("deltaValueBox").GetProperty("Value"), etyOPCSampleGroup.DeltaValue);
                bool   bChecked = (bool)oPCSampleGrpConfigStartAccessor.GetFieldAccessor("dateTimePicker").GetProperty("Checked");
                string str      = "";
                if (bChecked)
                {
                    str = ((DateTime)oPCSampleGrpConfigStartAccessor.GetFieldAccessor("dateTimePicker").GetProperty("Value")).ToString("HH:mm");
                }
                Assert.AreEqual(str, etyOPCSampleGroup.StartTime);
                string strrr = (string)oPCSampleGrpConfigStartAccessor.GetField("m_editIntervalGrpID");
                bool   bVal  = false;
                if (strrr == "")
                {
                    bVal = true;
                }
                Assert.AreEqual(bVal, etyOPCSampleGroup.NewData);
                #endregion

                //test3 invalid interval value

                try
                {
                    oPCSampleGrpConfigStartAccessor.GetFieldAccessor("intervalUnitBox").SetProperty("Value", (decimal)0);

                    //Test Procedure call
                    etyOPCSampleGroup = oPCSampleGrpConfigStart.GetEditFields();

                    #region PostCheck
                    //Post Condition check
                    Assert.IsNull(etyOPCSampleGroup);
                    #endregion
                }
                catch (System.Exception ex)
                {
                }

                //test4 different intervaltype
                oPCSampleGrpConfigStartAccessor.Call("InitializeControlsCaptions");
                oPCSampleGrpConfigStartAccessor.GetFieldAccessor("intervalTypeBox").SetProperty("SelectedIndex", OPCSampleGrpConfigStart.INTERVALETYPE_HOUR_INDEX);
                //Test Procedure call
                etyOPCSampleGroup = oPCSampleGrpConfigStart.GetEditFields();
                #region PostCheck
                //Post Condition check
                Assert.AreEqual(DAO.Trending.Helper.DAOHelper.HOUR, etyOPCSampleGroup.IntervalType);
                #endregion

                oPCSampleGrpConfigStartAccessor.GetFieldAccessor("intervalTypeBox").SetProperty("SelectedIndex", OPCSampleGrpConfigStart.INTERVALETYPE_SECOND_INDEX);
                //Test Procedure call
                etyOPCSampleGroup = oPCSampleGrpConfigStart.GetEditFields();
                #region PostCheck
                //Post Condition check
                Assert.AreEqual(DAO.Trending.Helper.DAOHelper.SECOND, etyOPCSampleGroup.IntervalType);
                #endregion

                oPCSampleGrpConfigStartAccessor.GetFieldAccessor("intervalTypeBox").SetProperty("SelectedIndex", OPCSampleGrpConfigStart.INTERVALETYPE_MINUTE_INDEX);
                //Test Procedure call
                etyOPCSampleGroup = oPCSampleGrpConfigStart.GetEditFields();
                #region PostCheck
                //Post Condition check
                Assert.AreEqual(DAO.Trending.Helper.DAOHelper.MINITE, etyOPCSampleGroup.IntervalType);
                #endregion
            }
        }