Ejemplo n.º 1
0
 TestCaseInfo IReflectionTestCaseFactory.CreateTestCase(MethodInfo method, TestDataInfo row)
 {
     return(new ReflectedTheoryCase(method, row)
     {
         RetargetDelegates = RetargetDelegates,
     });
 }
Ejemplo n.º 2
0
 TestCaseInfo IReflectionTestCaseFactory.CreateTestCase(MethodInfo method, TestDataInfo row)
 {
     return(new ReflectedTheoryCase(method, row)
     {
         IsFocused = true,
     });
 }
Ejemplo n.º 3
0
 TestCaseInfo IReflectionTestCaseFactory.CreateTestCase(MethodInfo method, TestDataInfo row)
 {
     return(new ReflectedTheoryCase(method, row)
     {
         IsPending = true,
         Reason = Reason,
     });
 }
Ejemplo n.º 4
0
        private ActionResult RenderIndexView(IEnumerable <TestData> testDataMore, int recordCount, int pageIndex)
        {
            TestDataInfo tdi = new TestDataInfo
            {
                TestDataMore        = testDataMore,
                SelectedTestData    = new TestData(),
                FindConditionEntity = new FindConditionEntity
                {
                    TestCaseId = Nameof <TestData> .Property(td => td.TestCaseId),
                    Name       = Nameof <TestData> .Property(td => td.Name),
                    Value      = Nameof <GlobalSetting> .Property(gs => gs.Value)
                }
            };
            Func <int, UrlHelper, string> pageUrlAccessor = (currentPage, helper) => helper.RouteUrl("TestDataPage", new { PageIndex = currentPage }).ToString();
            ViewResult result = View(tdi);

            ViewBag.RecordCount     = recordCount;
            ViewBag.PageIndex       = pageIndex;
            ViewBag.PageUrlAccessor = pageUrlAccessor;
            return(result);
        }
Ejemplo n.º 5
0
        private ActionResult Query(TestDataInfo info, int pageIndex)
        {
            this.TestDataService.CurrentProjectId = (int)Session["PID"];
            int    recordCount;
            string tcid;

            if (null == Session["TestCaseBound"])
            {
                tcid = info.FindConditionEntity.TestCaseId;
            }
            else
            {
                tcid = Session["TestCaseBound"].ToString();
            }
            IEnumerable <TestData> testDataMore = this.TestDataService.QueryTestDatas(tcid,
                                                                                      info.FindConditionEntity.Name, info.FindConditionEntity.Value, pageIndex, PagingInfo.PageSize, out recordCount);

            Session["HasQueried_t"]        = true;
            Session["QueriedPageIndex_t"]  = pageIndex;
            Session["FindConditionEntity"] = info.FindConditionEntity;
            return(RenderIndexView(testDataMore, recordCount, pageIndex));
        }
Ejemplo n.º 6
0
        public ActionResult Index(TestDataInfo info, int pageIndex = 1)
        {
            ActionResult ar = VerifyIfProjectSelected("PRJNAME");

            if (null != ar)
            {
                return(ar);
            }
            this.TestDataService.CurrentProjectId = (int)Session["PID"];
            string requestKey = Request.Form.Keys[Request.Form.Keys.Count - 1] as string;

            if (requestKey.Contains("."))
            {
                requestKey = requestKey.Substring(0, requestKey.IndexOf("."));
            }
            object pageindex = Session["QueriedPageIndex_t"] ?? pageIndex;

            switch (requestKey)
            {
            case "query":
                return(Query(info, 1));

            case "edit":
                return(Edit(info.SelectedTestData.Id, (int)pageindex));

            case "delete":
                return(Delete(info.SelectedTestData.Id, (int)pageindex));

            case "save":
                return(Save(info.SelectedTestData, (int)pageindex));

            default:
                Session["UpdatedId_t"] = null;
                Session["Log_t"]       = null;
                return(RedirectToAction("Index", new { pageIndex = (int)pageindex }));
            }
        }
Ejemplo n.º 7
0
 private ActionResult Edit(int tdid, int pageIndex)
 {
     Session["UpdatedId_t"] = tdid;
     if (null != Session["HasQueried_t"])
     {
         FindConditionEntity fce = Session["FindConditionEntity"] as FindConditionEntity;
         string tcid;
         if (null == Session["TestCaseBound"])
         {
             tcid = fce.TestCaseId;
         }
         else
         {
             tcid = Session["TestCaseBound"].ToString();
         }
         TestDataInfo info = new TestDataInfo {
             FindConditionEntity = new FindConditionEntity {
                 TestCaseId = tcid, Name = fce.Name, Value = fce.Value
             }
         };
         return(Query(info, pageIndex));
     }
     return(RedirectToAction("Index", new { pageIndex = pageIndex }));
 }
Ejemplo n.º 8
0
        void SerialDataManager_Feedback(ShouldPadMachine.ShouldPadMachineModel.UartComdEventArgs lowerDataInfo)
        {
            if (lowerDataInfo.LowerDataType == ShouldPadMachine.ShouldPadMachineAssist.Enum.LowerDataType.TestDataType)
            {
                TestDataInfo testDataInfo = lowerDataInfo.LowerDataInfo as TestDataInfo;
                if (formFlag == null)
                {
                    formFlag = new TestFormFlag();
                }
                if (formFlag.ServoSensor != testDataInfo.ServoSensor)
                {
                    formFlag.ServoSensor = testDataInfo.ServoSensor;
                    ReflectToObject(btnSFSensor, formFlag.ServoSensor == true ? "ON" : "OFF");
                }
                if (formFlag.xSensor != testDataInfo.XSensor)
                {
                    formFlag.xSensor = testDataInfo.XSensor;
                    ReflectToObject(btnXSensor, formFlag.xSensor == true ? "ON" : "OFF");
                }
                if (formFlag.ySensor != testDataInfo.YSensor)
                {
                    formFlag.ySensor = testDataInfo.YSensor;
                    ReflectToObject(btnYSensor, formFlag.ySensor == true ? "ON" : "OFF");
                }
                if (formFlag.greenKey1 != testDataInfo.GreenKey1)
                {
                    formFlag.greenKey1 = testDataInfo.GreenKey1;
                    ReflectToObject(btnGreenKey1, formFlag.greenKey1 == true ? "ON" : "OFF");
                }
                if (formFlag.redKey1 != testDataInfo.RedKey1)
                {
                    formFlag.redKey1 = testDataInfo.RedKey1;
                    ReflectToObject(btnRedKey1, formFlag.redKey1 == true ? "ON" : "OFF");
                }

                if (formFlag.greenKey2 != testDataInfo.GreenKey2)
                {
                    formFlag.greenKey2 = testDataInfo.GreenKey2;
                    ReflectToObject(btnGreenKey2, formFlag.greenKey2 == true ? "ON" : "OFF");
                }
                if (formFlag.redKey2 != testDataInfo.RedKey2)
                {
                    formFlag.redKey2 = testDataInfo.RedKey2;
                    ReflectToObject(btnRedKey2, formFlag.redKey2 == true ? "ON" : "OFF");
                }
                if (formFlag.clampSensorLower != testDataInfo.ClampSensorLower)
                {
                    formFlag.clampSensorLower = testDataInfo.ClampSensorLower;
                    ReflectToObject(btnClampSensorLower, formFlag.clampSensorLower == true ? "ON" : "OFF");
                }
                if (formFlag.clampSensorMid != testDataInfo.ClampSensorMid)
                {
                    formFlag.clampSensorMid = testDataInfo.ClampSensorMid;
                    ReflectToObject(btnClampSensorMid, formFlag.clampSensorMid == true ? "ON" : "OFF");
                }
                if (formFlag.clampSensorUp != testDataInfo.ClampSensorUp)
                {
                    formFlag.clampSensorUp = testDataInfo.ClampSensorUp;
                    ReflectToObject(btnClampSensorUp, formFlag.clampSensorUp == true ? "ON" : "OFF");
                }
                if (formFlag.carrySensorLeft != testDataInfo.CarrySensorLeft)
                {
                    formFlag.carrySensorLeft = testDataInfo.CarrySensorLeft;
                    ReflectToObject(btnCarrySensorLeft, formFlag.carrySensorLeft == true ? "ON" : "OFF");
                }
                if (formFlag.carrySensorRight != testDataInfo.CarrySensorRight)
                {
                    formFlag.carrySensorRight = testDataInfo.CarrySensorRight;
                    ReflectToObject(btnCarrySensorRight, formFlag.carrySensorRight == true ? "ON" : "OFF");
                }
                ReflectToObject(XstepCode, testDataInfo.Xstep_EnCode.ToString());
                ReflectToObject(YstepCode, testDataInfo.Ystep_EnCode.ToString());
                ReflectToObject(SFCode, testDataInfo.SF_EnCode.ToString());
                ReflectToObject(SFhallValue, testDataInfo.SF_HallValue.ToString());
                ReflectToObject(IOVolt, ((testDataInfo.IO_VOLT * 1.0) / 10).ToString());
            }
        }
        protected void SerialPortEx_DataArrived(byte[] uartDatas, byte comd)  //从串口接收数据的功能函数
        {
            LowerDataInfo lowerDataInfo = null;

            if (uartDatas != null)
            {
                switch (comd)
                {
                case 0x30:
                    lowerDataInfo = new MachineBasicDataInfo();
                    break;

                case 0x31:
                    serialDataHelper.SendComdFlag &= 0xFFFE;
                    ScreenStatueData.ScreenStatueDataEX.SendDesignFlag = false;
                    break;

                case 0x32:
                    serialDataHelper.SendComdFlag &= 0xFFFD;
                    break;

                case 0x33:
                    lowerDataInfo = new TestDataInfo();
                    serialDataHelper.SendComdFlag &= 0xFFFB;
                    break;

                case 0x34:
                    serialDataHelper.SendComdFlag &= 0xFFF7;
                    break;

                case 0x35:
                    serialDataHelper.SendComdFlag &= 0xFFEF;
                    break;

                case 0x36:
                    serialDataHelper.SendComdFlag &= 0xFFDF;
                    break;

                case 0x37:
                    serialDataHelper.SendComdFlag &= 0xFFBF;
                    lowerDataInfo = new ShouldPadPointInfo();
                    SerialDataManager.FlowFlag = false;
                    break;

                case 0x38:
                    serialDataHelper.SendComdFlag &= 0xFF7F;
                    SerialDataManager.ScreenButton = false;
                    ScreenStatueData.ScreenStatueDataEX.ResetBtnFlag   = false;
                    ScreenStatueData.ScreenStatueDataEX.BackwardNeedle = false;
                    ScreenStatueData.ScreenStatueDataEX.ForwardNeedle  = false;
                    break;

                case 0x39:
                    serialDataHelper.SendComdFlag &= 0xFEFF;
                    lowerDataInfo = new EncstaInfo();
                    break;

                case 0x3a:
                    serialDataHelper.SendComdFlag &= 0xFDFF;
                    MenuFormManager.SendUnLockFlag = false;
                    lowerDataInfo = new EncResInfo();
                    break;

                default:
                    break;
                }
                if (haveSendData || comd != 0x30)
                {
                    haveSendData = false;
                    serialDataModelCollect.Add(new SerialDataModel(SerialDataType.ReceiveData, comd, uartDatas));
                }
                if (lowerDataInfo != null)
                {
                    lowerDataInfo.LoadLowerData(uartDatas);
                    OnFeedBack(new UartComdEventArgs(lowerDataInfo));
                }
            }
            serialDataHelper.HaveReceiveData = true;
        }