示例#1
0
        public void TestMethod5()
        {
            var command = new Test3Command();

            var task = _tyrion.Execute(command);

            Assert.IsNotNull(task);
        }
        public async Task HandleExceptionOverwrittenAsync()
        {
            var viewModel = new TestViewModel();

            var cmd3 = new Test3Command();

            Assert.IsFalse(cmd3.ExceptionHandled);
            await Assert.ThrowsExceptionAsync <NotImplementedException>(async() => { await cmd3.ExecuteAsync(viewModel); });

            Assert.IsFalse(cmd3.ExceptionHandled);
            Assert.IsFalse(cmd3.IsWorking);
        }
        public void HandleExceptionOverwrittenFireAndForget()
        {
            var viewModel = new TestViewModel();

            var cmd3 = new Test3Command();

            Assert.IsFalse(cmd3.ExceptionHandled);
            cmd3.Execute(viewModel);

            while (cmd3.IsWorking)
            {
            }
            Assert.IsTrue(cmd3.ExceptionHandled);
            Assert.IsFalse(cmd3.IsWorking);
        }
示例#4
0
        public void TestsFromAGivenProjectShouldRunWithExpectedOutput()
        {
            // Copy DotNetCoreTestProject project in output directory of project dotnet-vstest.Tests
            string       testAppName  = "VSTestDotNetCoreProject";
            TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);

            string testProjectDirectory = testInstance.TestRoot;

            // Restore project VSTestDotNetCoreProject
            new Restore3Command()
            .WithWorkingDirectory(testProjectDirectory)
            .Execute()
            .Should()
            .Pass();

            // Call test3
            CommandResult result = new Test3Command().WithWorkingDirectory(testProjectDirectory).ExecuteWithCapturedOutput("/p:TargetFramework=netcoreapp1.0");

            // Verify
            result.StdOut.Should().Contain("Total tests: 2. Passed: 1. Failed: 1. Skipped: 0.");
            result.StdOut.Should().Contain("Passed   TestNamespace.VSTestTests.VSTestPassTest");
            result.StdOut.Should().Contain("Failed   TestNamespace.VSTestTests.VSTestFailTest");
        }
示例#5
0
 public async Task Execute(Test3Command request)
 {
     await Task.CompletedTask;
 }