Beispiel #1
0
 public void CheckOperationExecution()
 {
     _processor.AssignOperation(_operation);
     _operation.Properties.Schedule.OperationScheduleElapsed();
     Assert.AreEqual(_processor.Operations.Count, 1);
     Assert.AreEqual(_processor.OperationsToExecute.Count, 1);
     _processor.ProcessOperation();
     Assert.AreEqual(_processor.Operations.Count, 1);
     Assert.AreEqual(_processor.OperationsToExecute.Count, 0);
 }
        protected override string ProcessRequest(HttpListenerRequest httpListenerRequest)
        {
            _totalRequests++;

            var result = base.ProcessRequest(httpListenerRequest);

            var urlSegments          = httpListenerRequest.RawUrl.Split('/');
            var processingStartIndex = GetFirstValidSegmentIndexFromUrlSegments(urlSegments);

            if (processingStartIndex == InvalidOperationIndex)
            {
                return(ResponseString);
            }

            if (urlSegments[processingStartIndex].ToLower() == OperationProcessor.MetricString)
            {
                result = _metricProcessor.ProcessOperation(urlSegments[processingStartIndex + 1].ToLower(), httpListenerRequest, ResponseString);
            }

            return(result);
        }