Ejemplo n.º 1
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);
                }
            }
        }
Ejemplo n.º 2
0
 public void TestException_Main03()
 {
     string[] argsvar = new string[1];
     argsvar[0] = "view-edit-0";
     ReflectionAccessor.Wrap("OPCSampleGrpConfig.Program").Call("Main", argsvar);
     OPCSampleGrpConfig.Common.FormCaptionHelper.ReleaseInstance();
 }
Ejemplo n.º 3
0
        public void TestAll()
        {
            DatabaseSession databaseSession = new DatabaseSession("Invalid Connection String;");

            databaseSession.OpenConnection();

            Accessor databaseSessionAccessor = ReflectionAccessor.Wrap(databaseSession);

            databaseSessionAccessor.Call("GetConnection", DBType.Oracle);
            databaseSessionAccessor.Call("GetConnection", DBType.MySql);

            databaseSessionAccessor.SetField("m_dbType", DBType.Oracle);
            databaseSession.GetParameterDelimiter();
            databaseSessionAccessor.SetField("m_dbType", DBType.MySql);
            databaseSession.GetParameterDelimiter();

            databaseSession.CheckDatabaseConnection();

            try
            {
                databaseSession.CommitTransaction(); //throw exception
            }
            catch (System.Exception ex)
            {
            }
            try
            {
                databaseSession.RollBackTransaction(); //throw exception
            }
            catch (System.Exception ex)
            {
            }
        }
Ejemplo n.º 4
0
        public void TestAddOperator01()
        {
            Tree tree = new Tree();
            ArithmeticMultiply expression = new ArithmeticMultiply();
            ExprNode           Addexpr    = new ExprNode(expression);

            System.Collections.ArrayList operands = new System.Collections.ArrayList();
            Constant operand1 = new Constant(1);
            ExprNode expr1    = new ExprNode(operand1);
            Constant operand2 = new Constant(2);
            ExprNode expr2    = new ExprNode(operand2);

            operands.Add(expr1);
            operands.Add(expr2);
            Accessor exprAccessor = ReflectionAccessor.Wrap(Addexpr);

            exprAccessor.SetField("_operands", operands);
            BooleanAnd Multiexpression = new BooleanAnd();

            tree.Root = Addexpr;
            Accessor treeAccessor = ReflectionAccessor.Wrap(tree);

            treeAccessor.SetField("_top", Addexpr);
            //Test Procedure Call
            tree.AddOperator(Multiexpression);
        }
Ejemplo n.º 5
0
        public void TestLoadEditData01()
        {
            //Test1 empty samplegrpID
            string   editIntervalGrpID = "1";
            Accessor oPCSampleGrpConfigStartControllerAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStartController);

            oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").Call("InitializeControlsCaptions");
            List <EtyDataLogDPGroupTrend> oPCSampleGrpList = new List <EtyDataLogDPGroupTrend>();
            EtyDataLogDPGroupTrend        sampleGrp        = new EtyDataLogDPGroupTrend();

            sampleGrp.SampleGrpID   = 1;
            sampleGrp.SampleGrpName = "testing";
            sampleGrp.Disabled      = true;
            oPCSampleGrpList.Add(sampleGrp);
            oPCSampleGrpConfigStartControllerAccessor.SetField("m_DPGroupTrendList", oPCSampleGrpList);

            //Test Procedure Call
            oPCSampleGrpConfigStartControllerAccessor.Call("LoadEditData", editIntervalGrpID);
            //Post Condition Check
            #region PostConditionCheck
            //Accessor oPCSampleGrpConfigStartAccessor = ReflectionAccessor.Wrap(oPCSampleGrpConfigStartControllerAccessor.GetField("m_view"));
            Assert.AreEqual("testing", oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").GetFieldAccessor("intervalNameTextBox").GetProperty("Text"));
            Assert.AreEqual("", oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").GetFieldAccessor("intervalDescTextBox").GetProperty("Text"));
            Assert.AreEqual(1, oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").GetFieldAccessor("intervalUnitBox").GetProperty("Value"));
            Assert.AreEqual(OPCSampleGrpConfigStart.INTERVALETYPE_MINUTE_INDEX, oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").GetFieldAccessor("intervalTypeBox").GetProperty("SelectedIndex"));
            Assert.AreEqual(1, oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").GetFieldAccessor("deltaValueBox").GetProperty("Value"));
            Assert.AreEqual(false, oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").GetFieldAccessor("dateTimePicker").GetProperty("Checked"));
            Assert.AreEqual(true, oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").GetFieldAccessor("disableCheckBox").GetProperty("Checked"));
            Assert.AreEqual(false, oPCSampleGrpConfigStartControllerAccessor.GetFieldAccessor("m_view").GetFieldAccessor("intervalNameTextBox").GetProperty("Enabled"));
            #endregion
        }
Ejemplo n.º 6
0
        public void TestMessageBoxFormConstructor01()
        {
            MessageBoxForm messageBoxForm     = new MessageBoxForm();
            Accessor       messageBoxAccessor = ReflectionAccessor.Wrap(messageBoxForm);

            messageBoxAccessor.Call("CleanUp");
        }
Ejemplo n.º 7
0
        public static System.Boolean WaitOneMSS(
            System.Threading.WaitHandle target)
        {
            object result;

            if (TestSpecificStubsUtil.RunTestSpecificStub(System.Reflection.MethodBase.GetCurrentMethod(), new object[] { target }, out result))
            {
                return((System.Boolean)result);
            }
            else
            {
                kk++;
                if (kk == 1)
                {
                    return(target.WaitOne());
                }
                else
                {
                    OPCDataLogger.OPCLoggerWriteQuene writeQueue = OPCDataLogger.DotTest.Factories.OPCLoggerWriteQueneFactory.CreateOPCLoggerWriteQuene01();
                    Accessor writeQAccessor = ReflectionAccessor.Wrap(writeQueue);
                    writeQAccessor.SetField("m_terminate", true);
                    kk = 0;
                    return(true);
                }
            }
        }
Ejemplo n.º 8
0
        public void TestDispose01()
        {
            bool     disposing         = true;
            Accessor trendViewAccessor = ReflectionAccessor.Wrap(trendView);

            trendViewAccessor.Call("Dispose", disposing);
        }
Ejemplo n.º 9
0
 public void TestCreateWin32EventAndSetLogFile02()
 {
     //todo:stub: hEvent = OpenEvent(0x1F0003, false, eventName)  hEvent!=IntPtr.Zero
     //todo:stub: CloseHandle do nothing
     StaticAccessor programAccessor = ReflectionAccessor.Wrap(typeof(Program));
     string         str             = (string)programAccessor.Call("CreateWin32EventAndSetLogFile");
 }
Ejemplo n.º 10
0
        public void TestcolorCmd_Click02()
        {
            Accessor formulaDataAccessor = ReflectionAccessor.Wrap(formulaData);

            formulaDataAccessor.SetField("colorDialog1", null); //throw exception
            formulaDataAccessor.Call("colorCmd_Click", null, null);
        }
Ejemplo n.º 11
0
        public void TestEditDataPointFormula_Load01()
        {
            Accessor formulaDataAccessor = ReflectionAccessor.Wrap(formulaData);

            formulaData.SetFormType(FormType.Add);
            formulaDataAccessor.Call("EditDataPointFormula_Load", null, null);

            formulaData.SetFormType(FormType.Edit);
            FormulaDataController ctl = (FormulaDataController)(formulaDataAccessor.GetField("m_controller"));

            ctl = new FormulaDataController();


            Accessor   ctlAccessor = ReflectionAccessor.Wrap(ctl);
            EtyFormula record      = (EtyFormula)(ctlAccessor.GetField("m_formula"));

            record            = new EtyFormula();
            record.DPEquation = "::a+::b";
            record.DPLblName  = "TestFormula";
            record.DPColor    = "-32704";
            ctlAccessor.SetField("m_formula", record);
            formulaDataAccessor.SetField("m_controller", ctl);

            formulaDataAccessor.Call("EditDataPointFormula_Load", null, null);
        }
Ejemplo n.º 12
0
        public void TestEditDataPointFormula_Load02()
        {
            formulaData.SetFormType(FormType.Add);
            Accessor formulaDataAccessor = ReflectionAccessor.Wrap(formulaData);

            formulaDataAccessor.Call("EditDataPointFormula_Load", null, null);
        }
Ejemplo n.º 13
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);
            }
        }
Ejemplo n.º 14
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"));
            }
        }
Ejemplo n.º 15
0
        public void TestCalculateButtons01()
        {
            MessageBoxForm messageBoxForm     = new MessageBoxForm();
            Accessor       messageBoxAccessor = ReflectionAccessor.Wrap(messageBoxForm);
            //Test procedure Call
            int numberOfButtons = (int)messageBoxAccessor.Call("CalculateButtons", MessageBoxButtons.OKCancel);

            //Post Condition Check
            Assert.AreEqual(2, numberOfButtons);

            //test ---
            //Test procedure Call
            numberOfButtons = (int)messageBoxAccessor.Call("CalculateButtons", MessageBoxButtons.OK);
            //Post Condition Check
            Assert.AreEqual(1, numberOfButtons);

            //test ---
            //Test procedure Call
            numberOfButtons = (int)messageBoxAccessor.Call("CalculateButtons", MessageBoxButtons.AbortRetryIgnore);
            //Post Condition Check
            Assert.AreEqual(3, numberOfButtons);

            //test ---
            //Test procedure Call
            numberOfButtons = (int)messageBoxAccessor.Call("CalculateButtons", (MessageBoxButtons)99);
            //Post Condition Check
            Assert.AreEqual(1, numberOfButtons);
        }
Ejemplo n.º 16
0
        public void TestAddHistDataPointData_ModifyHistDataPoint_03()
        {
            //! m_View.GetStartDate() > m_View.GetEndDate()
            //m_View.GetHistDataPointName() !=""

            Accessor ctlAccessor = ReflectionAccessor.Wrap(histDataPointDataController);

            TrendViewer.View.HistDataPointData view = (TrendViewer.View.HistDataPointData)ctlAccessor.GetField("m_View");
            EtyHistDataPoint dp = new EtyHistDataPoint();

            dp.DPName          = "tempName";
            dp.DPStartDateTime = new DateTime(2013, 1, 1);
            dp.DPEndDateTime   = new DateTime(2013, 1, 2);
            view.SetFormType(FormType.Edit);
            view.Display(dp);

            // HistDataPointNameValid(dpName)
            histDataPointDataController.AddHistDataPointData(null, null);
            histDataPointDataController.ModifyHistDataPoint(null, null);

            //!HistDataPointNameValid(dpName)
            dp.DPName = "dpName1";
            view.Display(dp);
            histDataPointDataController.AddHistDataPointData(null, null);
            histDataPointDataController.ModifyHistDataPoint(null, null);
        }
Ejemplo n.º 17
0
        public void TestSelectDefaultButton01()
        {
            MessageBoxForm messageBoxForm     = new MessageBoxForm();
            Accessor       messageBoxAccessor = ReflectionAccessor.Wrap(messageBoxForm);

            messageBoxAccessor.SetField("m_button3", new Button());
            messageBoxAccessor.SetField("m_button2", new Button());
            messageBoxAccessor.SetField("m_button1", new Button());
            //test Procedure Call
            messageBoxForm.SelectDefaultButton(MessageBoxDefaultButton.Button2);
            //test Procedure Call
            messageBoxForm.SelectDefaultButton(MessageBoxDefaultButton.Button1);
            //test Procedure Call
            messageBoxForm.SelectDefaultButton(MessageBoxDefaultButton.Button3);


            ///testing scenario
            messageBoxAccessor.SetField("m_button3", null);
            //test Procedure Call
            messageBoxForm.SelectDefaultButton(MessageBoxDefaultButton.Button2);
            //test Procedure Call
            messageBoxForm.SelectDefaultButton(MessageBoxDefaultButton.Button1);

            ///testing scenario
            messageBoxAccessor.SetField("m_button2", null);
            //test Procedure Call
            messageBoxForm.SelectDefaultButton(MessageBoxDefaultButton.Button1);

            //default case testing
            messageBoxForm.SelectDefaultButton((MessageBoxDefaultButton)444);
        }
Ejemplo n.º 18
0
 public void TestInitializeAndConnectOPCServer01()
 {
     OPCDataPointManager oPCDataPointManager    = OPCDataPointManager.GetInstance();
     Accessor            oPCLoggerCacheAccessor = ReflectionAccessor.Wrap(oPCDataPointManager);
     bool b = oPCDataPointManager.InitializeAndConnectOPCServer();
     //Post Test Condition Check
 }
Ejemplo n.º 19
0
        public void TestMain01()
        {
            StaticAccessor programAccessor = ReflectionAccessor.Wrap(typeof(Program));

            //Test Procedure Call
            programAccessor.Call("Main");
        }
Ejemplo n.º 20
0
        public void TestGetNextSampleTime01()
        {
            //Test --- First time called for intialization of the logger datapoints
            // Current time is greater than start time
            OPCDataPointManager oPCDataPointManager = OPCDataPointManager.GetInstance();
            DateTime            currenttime         = System.DateTime.Now;

            currenttime = new DateTime(currenttime.Year, currenttime.Month, currenttime.Day, (currenttime.Hour - 1), currenttime.Minute, 0, 0);
            double   intervalInSecs         = 120;
            Accessor oPCLoggerCacheAccessor = ReflectionAccessor.Wrap(oPCDataPointManager);
            DateTime dateTime = (DateTime)oPCLoggerCacheAccessor.Call("GetNextSampleTime", currenttime, intervalInSecs, true);

            //Post Test Condition Check
            currenttime = System.DateTime.Now;
            currenttime = new DateTime(currenttime.Year, currenttime.Month, currenttime.Day, currenttime.Hour, currenttime.Minute, 0, 0);
            DateTime time = currenttime.AddSeconds(120);

            Assert.AreEqual(time, dateTime);


            ////Test 2 --- Second time called for calculating next log time
            // Current time is greater than planned log time
            //current time is System.DateTime dt = new DateTime(2013, 01, 29, 14, 25, 50);
            currenttime = System.DateTime.Now;
            currenttime = new DateTime(currenttime.Year, currenttime.Month, currenttime.Day, currenttime.Hour, currenttime.Minute - 1, 0, 0);
            DateTime dateTime1 = (DateTime)oPCLoggerCacheAccessor.Call("GetNextSampleTime", currenttime, intervalInSecs, false);

            //Post Test Condition Check
            currenttime = currenttime.AddSeconds(120);
            Assert.AreEqual(currenttime, dateTime1);
        }
Ejemplo n.º 21
0
 public void TestInitializeComponent01()
 {
     using (HistDataPointData histDataPointData = HistDataPointDataFactory.CreateHistDataPointData01())
     {
         Accessor histDataPointDataAccessor = ReflectionAccessor.Wrap(histDataPointData);
     }
 }
Ejemplo n.º 22
0
        public void TestMoveToPublic01()
        {
            Accessor groupAccessor = ReflectionAccessor.Wrap(group);

            //Test Procedure Call
            group.MoveToPublic();
        }
Ejemplo n.º 23
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);
        }
Ejemplo n.º 24
0
        public void TestInitializeDataPointListDataGridView()
        {
            //Exception
            Accessor formAccessor = ReflectionAccessor.Wrap(dataPointList);

            formAccessor.Call("InitializeDataPointListDataGridView");
        }
Ejemplo n.º 25
0
        public void TestRun02()
        {
            //Testing ----- invalid datapoint Value from OPCProxy
            OPCLoggerQuene oPCLoggerQuene         = OPCLoggerQueneFactory.CreateOPCLoggerQuene02();
            Accessor       oPCLoggerQueneAccessor = ReflectionAccessor.Wrap(oPCLoggerQuene);

            oPCLoggerQueneAccessor.SetField("m_serviceStarted", true);
            Dictionary <string, OPCDPGrpDetails> opcdic = new Dictionary <string, OPCDPGrpDetails>();
            OPCDPGrpDetails deta1 = new OPCDPGrpDetails();

            opcdic.Add("testingDP1", new OPCDPGrpDetails());
            Accessor oPCMagerAccessor = ReflectionAccessor.Wrap(OPCDataPointManager.GetInstance());

            oPCMagerAccessor.SetField("m_DataPointdic", opcdic);
            System.Threading.ThreadStart func = new System.Threading.ThreadStart(oPCLoggerQuene.Run);
            System.Threading.Thread      t1   = new System.Threading.Thread(func);
            t1.Start();
            //wait till test completes
            m_OPCLoggerQuenesignal.WaitOne();

            //PostCondition Check
            //check no data point in WriteQuene.
            Assert.AreEqual(0, oPCMagerAccessor.GetFieldAccessor("m_writeQuene").GetFieldAccessor("m_writeQuene").GetProperty("Count"));


            //release all instances
            OPCDataPointManager.ReleaseInstance();
            OPCLoggerQueneFactory.ReleaseOPCLoggerQuene02();
        }
Ejemplo n.º 26
0
        public void TestDataMarkerViewer_Load02()
        {
            //Exception caught
            Accessor markerListAccessor = ReflectionAccessor.Wrap(markerList);

            markerListAccessor.Call("DataMarkerViewer_Load", null, null);
        }
Ejemplo n.º 27
0
        public void TestGetAllOPCSampelGrp01()
        {
            OPCSampleGrpConfigStartModel oPCSampleGrpConfigStartModel = OPCSampleGrpConfigStartModelFactory.CreateOPCSampleGrpConfigStartModel01();
            string sortCol      = string.Empty;
            string sortingOrder = string.Empty;
            int    lowerRecord  = -1;
            int    upperRecord  = 1;
            List <EtyDataLogDPGroupTrend> list = oPCSampleGrpConfigStartModel.GetAllOPCSampelGrp(sortCol, sortingOrder, lowerRecord, upperRecord);

            #region Record State
            ValueRecorder recorder = new ValueRecorder();
            recorder.Record <int>(delegate { return((int)list.Capacity); });
            recorder.Record <int>(delegate { return((int)list.Count); });
            recorder.Record <bool>(delegate { return((bool)ReflectionAccessor.Wrap(list).GetProperty("System.Collections.Generic.ICollection<T>.IsReadOnly")); });
            recorder.Record <bool>(delegate { return((bool)ReflectionAccessor.Wrap(list).GetProperty("System.Collections.ICollection.IsSynchronized")); });
            recorder.Record <bool>(delegate { return((bool)ReflectionAccessor.Wrap(list).GetProperty("System.Collections.IList.IsFixedSize")); });
            recorder.Record <bool>(delegate { return((bool)ReflectionAccessor.Wrap(list).GetProperty("System.Collections.IList.IsReadOnly")); });
            recorder.FinishRecording();
            #endregion
            // ExpectedException custom attribute was generated instead of
            // assertions since the test threw System.ArgumentOutOfRangeException
            #region PostConditionCheck
            Assert.AreEqual(0, list.Count);
            #endregion

            //Test2 ---- Valid Input
            sortCol      = OPCSampleGrpConfigStart.OPCSAMPLEGRPDESC_COL_NAME;
            sortingOrder = OPCSampleGrpConfigStart.OPCSAMPLEGRP_SORT_ASC;
            lowerRecord  = 0;
            upperRecord  = 8;
            list         = oPCSampleGrpConfigStartModel.GetAllOPCSampelGrp(sortCol, sortingOrder, lowerRecord, upperRecord);
            #region PostConditionCheck
            //Assert.Greater(0, list.Count);
            #endregion
        }
Ejemplo n.º 28
0
        public void TestShowButton01()
        {
            MessageBoxForm messageBoxForm     = new MessageBoxForm();
            Accessor       messageBoxAccessor = ReflectionAccessor.Wrap(messageBoxForm);

            messageBoxAccessor.Call("ShowButton", new Button(), "OK", 1);
        }
Ejemplo n.º 29
0
        public void TestFinalize01()
        {
            OPCLoggerCache oPCLoggerCache = OPCLoggerCacheFactory.CreateOPCLoggerCache01();
            Accessor       cacheAccessor  = ReflectionAccessor.Wrap(oPCLoggerCache);

            cacheAccessor.Call("Finalize");
        }
Ejemplo n.º 30
0
        public void TestDoEval01()
        {
            //testing --- not primitive types are compared
            AdditiveOp op = new AdditiveOp();

            op.ToString();
            Accessor  opAccessor = ReflectionAccessor.Wrap(op);
            Evaluator evaluater  = new Evaluator();

            Result[] argArray = new Result[2];
            Result   res1     = new Result("string");
            Result   res2     = new Result(2);

            argArray[0] = res1;
            argArray[1] = res2;
            //Test Procedure Call
            Result result = (Result)opAccessor.Call("DoEval", evaluater, argArray);

            //Post Condition Check
            Assert.AreEqual("string2", result.Value);

            //testing -- null type
            argArray    = new Result[2];
            res1        = new Result(null, null);
            res2        = new Result(null, null);
            argArray[0] = res1;
            argArray[1] = res2;
            //Test Procedure Call
            result = (Result)opAccessor.Call("DoEval", evaluater, argArray);
            //Post Condition Check
        }