Esempio n. 1
0
        private async Task InitializeAsync()
        {
            this.Status = "Running tests...";

            var selfTestService = new SelfTestService();

            this.runResult = await selfTestService.RunTestsAsync(this.dte, this.classesProject, this.targetProjects);

            // For now just display the first detection failure
            if (this.runResult.DetectionFailures.Count > 0)
            {
                this.Status = this.runResult.DetectionFailures[0];
                return;
            }

            this.failures = new List <SelfTestFileFailure>(this.runResult.FileFailures);

            this.succeededCount = this.runResult.FilesSucceededCount;

            if (this.failures.Count == 0)
            {
                this.ShowSuccess();
            }
            else
            {
                this.ShowingDiff = true;
                this.RefreshUI();
            }
        }
        public async Task <SelfTestRunResult> RunTestsAsync(DTE2 dte, Project classesProject, IList <Project> targetProjects)
        {
            var result = new SelfTestRunResult();

            this.Clean(targetProjects);

            SelfTestDetectionsResult detectionsResult = this.RunDetectionTests(targetProjects);

            result.DetectionFailures        = detectionsResult.Failures;
            result.TotalDetectionsCount     = detectionsResult.TotalCount;
            result.DetectionsSucceededCount = detectionsResult.SucceededCount;

            await this.GenerateTestFilesAsync(classesProject);

            SelfTestFileComparesResult fileComparesResult = this.AnalyzeFileResults(dte);

            result.FileFailures        = fileComparesResult.Failures;
            result.FilesSucceededCount = fileComparesResult.SucceededCount;
            result.TotalFilesCount     = fileComparesResult.TotalCount;

            return(result);
        }