public TestResultsInStatusViewModel GetTestsFromSessionInStatus(long sessionId, string browserName, TestResultStatus status)
        {
            var query       = new FindTestResultsFromSession(sessionId, browserName, status);
            var testResults = this.testRepository.FindAll(query);

            return(new TestResultsInStatusViewModel()
            {
                TestResults = testResults.ConvertAll(MapToTestResultListItemDTO)
            });
        }
        public TestResultListViewModel GetTestsFromSession(long sessionId, string browserName)
        {
            var query       = new FindTestResultsFromSession(sessionId, browserName, TestResultStatus.All);
            var testResults = this.testRepository.FindAll(query);
            var failedCount = testResults.Count(x => x.TestPassed == false);

            return(new TestResultListViewModel()
            {
                AllCount = testResults.Count,
                FailedCount = failedCount,
                PassedCount = testResults.Count - failedCount,
                TestSessionId = sessionId,
                BrowserName = browserName,
                TestResults = testResults.ConvertAll(MapToTestResultListItemDTO)
            });
        }
        public TestResultListViewModel GetTestsFromSession(long sessionId, string browserName)
        {
            var query       = new FindTestResultsFromSession(sessionId, browserName, TestResultStatusFilter.All);
            var testResults = this.testRepository.FindAll(query);
            var failedCount = testResults.Count(x => x.Status == TestResultStatus.Failed);
            var passedCount = testResults.Count(x => x.Status == TestResultStatus.Passed);
            var newCount    = testResults.Count(x => x.Status == TestResultStatus.NewPattern);

            return(new TestResultListViewModel()
            {
                AllCount = testResults.Count,
                FailedCount = failedCount,
                PassedCount = passedCount,
                NewCount = newCount,
                TestSessionId = sessionId,
                BrowserName = browserName,
                TestResults = testResults.ConvertAll(MapToTestResultListItemDTO)
            });
        }