예제 #1
0
파일: Runner.cs 프로젝트: vincoss/glut
 public Runner(IWorker worker, ThreadResult threadResult, ILogger <Runner> logger)
 {
     if (worker == null)
     {
         throw new ArgumentNullException(nameof(worker));
     }
     if (threadResult == null)
     {
         throw new ArgumentNullException(nameof(threadResult));
     }
     if (logger == null)
     {
         throw new ArgumentNullException(nameof(logger));
     }
     _worker       = worker;
     _threadResult = threadResult;
     _logger       = logger;
 }
예제 #2
0
        public void Test()
        {
            var result = new ThreadResult();

            var start = DateTime.UtcNow;

            result.Add("/", start, start.AddSeconds(1), true, 200, 100, 200, 2000, 3000, "Headers", new Exception("Error"));

            Assert.Equal(1, result.Results.Count);
            Assert.Equal(1, result.TotalResults);
            Assert.Equal(2000, result.TotalRequestTicks);
            Assert.Equal(3000, result.TotalResponseTicks);
            Assert.Equal(5000, result.TotalTicks);
            Assert.Equal(100, result.TotalHeaderLength);
            Assert.Equal(200, result.TotalResponseLength);
            Assert.Equal(300, result.TotalLength);

            Assert.Equal("Total - results: 1, time: 00:00:00.0005000, length: 300", result.ToString());
        }