コード例 #1
0
        public void Run(String serverURI, CoAP.Tester.FormMain.StepOperation stepOperation)
        {
            if (String.IsNullOrEmpty(serverURI))
            {
                throw new ArgumentNullException("serverURI");
            }

            _reasons = null;

            Request request = PrepareRequest();

            Uri uri = new Uri(new Uri(serverURI), ResourceURI);

            request.URI = uri;

            request.Respond += new EventHandler <ResponseEventArgs>(request_Respond);

            request.Send();

            if (Sync)
            {
                Boolean running = true;
                request.Timeout += (o, e) => running = false;

                while (running)
                {
                    Response response = request.WaitForResponse();
                    //if (response == null || !response.IsEmptyACK)
                    //    break;
                }
            }
        }
コード例 #2
0
ファイル: FlowTest.cs プロジェクト: Mfantasy/SessionTest
        public void Run(String serverURI, CoAP.Tester.FormMain.StepOperation stepOperation)
        {
            Passed     = true;
            _summaries = new StringBuilder();
            _summary   = null;

            tcItem               = new TestCaseItem();
            tcItem.Name          = TC.Name;
            tcItem.Group         = TC.Group;
            tcItem.TestCaseName  = TC.Name;
            tcItem.StepItemList  = new List <StepItem>();
            tcItem.stepOperation = stepOperation;
            TestContext context = new TestContext();

            context.Verbose.AppendLine("   TESTER     \t          \tDUT");

            Int32 stepIndex = 1;

            int stepCount         = _steps.Count;
            int executedStepCount = 0;

            tcItem.stepOperation("", 0);
            foreach (IStep step in _steps)
            {
                executedStepCount++;
                int value = (executedStepCount * 100) / stepCount;
                context.Verbose.Append(stepIndex++).Append(". ");
                //_summaries.Append(stepIndex++).Append(". ")
                //    .Append(step.GetType().Name).Append("\t");
                if (step.Go(context, serverURI, tcItem, value))
                {
                    //context.Verbose.AppendLine("\tPASSED");
                    context.Verbose.AppendLine();
                    _summaries.AppendLine("PASSED");
                }
                else
                {
                    //context.Verbose.AppendLine("\tFAILED");
                    context.Verbose.AppendLine();
                    Passed = false;
                    _summaries.AppendLine("FAILED");
                    foreach (var item in step.Summaries)
                    {
                        _summaries.Append("\t- ").AppendLine(item);
                        context.Verbose.Append("\t- ").AppendLine(item);
                    }
                }
                tcItem.IsPassed = Passed;
                //_stepItemList.Add(tcItem);
                _summary = null;
            }
            context.Verbose.AppendLine().AppendLine(Passed ? "   PASSED" : "   FAILED");
            _summary = context.Verbose.ToString();
        }
コード例 #3
0
 public void Run(String serverURI, CoAP.Tester.FormMain.StepOperation stepOperation)
 {
 }