Beispiel #1
0
        public async Task Test_returns_a_project_for_every_test_in_startup_config()
        {
            _dotnetServiceMock.Setup(m => m.Test(It.IsAny <Project>(), It.IsAny <string>(), It.IsAny <CommandOptions>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync((Project p, string d, CommandOptions o, CancellationToken c) => new AppProcess(new Process(), AppTask.Start, AppStatus.Success, p?.Port))
            .Verifiable();

            var testsProjects = SampleProjects.ConfigurationGood.Projects.WhereTest().ToList();

            var processes = await _runnerService.TestAsync(testsProjects, TestOptions.Create(), CancellationToken.None);

            Assert.Equal(testsProjects.Count, processes.Count);

            _dotnetServiceMock.VerifyAll();
        }
Beispiel #2
0
        protected override async Task <int> ExecuteAsync(IList <Project> projects, CancellationToken cancellationToken)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            await _runnerService.TestAsync(projects, Options, cancellationToken);

            stopwatch.Stop();

            var output = _summaryService.PrintTestSummary(projects, stopwatch.Elapsed);

            return(output.FailCount);
        }