示例#1
0
        public void RunUnitTests_WhenAndTestsFail_ShouldThrowExceptions()
        {
            var baselineCreatorRunUnitTestsHandler = new BaselineCreatorRunUnitTestsHandler(
                TestRunnerClientCreator.CreateNegative(),
                _testRunnerDependencyFilesHandler);

            Assert.ThrowsAsync <BaselineException>(async() => await baselineCreatorRunUnitTestsHandler.RunUnitTests(_config, BaseLineDirectoryPath));
        }
        public async Task ExecuteMutationAsync_WhenExecuteMutationAndTestFails_ShouldSetMutationsAsNotSurvived()
        {
            var compiler   = ProjectCompilerCreator.CreatePositiveCompiler(_fileSystem);
            var testRunner = TestRunnerClientCreator.CreateNegative();

            var mutationDocumentExecutor = new MutationDocumentExecutor(compiler, _dependency, testRunner, _fileSystem);
            var result = await mutationDocumentExecutor.ExecuteMutationAsync(_config, _mutationDocument);

            Assert.IsFalse(result.Survived);
        }
        public void SetUp()
        {
            _fileSystem        = new MockFileSystem();
            _config            = ConfigCreator.CreateConfig(_fileSystem);
            _mutationDocuments = new MutationDocumentCreator().CreateMutations(_config);

            var dependency = new TestRunnerDependencyFilesHandler(_fileSystem);

            var compiler   = ProjectCompilerCreator.CreatePositiveCompiler(_fileSystem);
            var testRunner = TestRunnerClientCreator.CreateNegative();

            _mutationExecutor = new MutationDocumentExecutor(compiler, dependency, testRunner, _fileSystem);
        }
示例#4
0
        public void RunUnitTests_WhenAndWeCancel_ShouldThrowCancelExceptions()
        {
            var baselineCreatorRunUnitTestsHandler = new BaselineCreatorRunUnitTestsHandler(
                TestRunnerClientCreator.CreateNegative(),
                _testRunnerDependencyFilesHandler);

            var cts   = new CancellationTokenSource();
            var token = cts.Token;

            cts.Cancel();

            Assert.ThrowsAsync <TaskCanceledException>(async() => await baselineCreatorRunUnitTestsHandler.RunUnitTests(_config, BaseLineDirectoryPath, token));
        }