Esempio n. 1
0
        public void LaunchProcessWithDebuggerAttachedShouldNotCallCustomLauncherIfTestRunIsNotInProgress()
        {
            var mockCustomLauncher = new Mock <ITestHostLauncher>();

            testRunCriteria = new TestRunCriteria(new List <string> {
                "foo"
            }, 1, false, null, TimeSpan.Zero, mockCustomLauncher.Object);
            executionManager = new Mock <IProxyExecutionManager>();
            testRunRequest   = new TestRunRequest(testRunCriteria, executionManager.Object);

            var testProcessStartInfo = new TestProcessStartInfo();

            testRunRequest.LaunchProcessWithDebuggerAttached(testProcessStartInfo);

            mockCustomLauncher.Verify(ml => ml.LaunchTestHost(It.IsAny <TestProcessStartInfo>()), Times.Never);
        }
Esempio n. 2
0
        public void LaunchProcessWithDebuggerAttachedShouldCallCustomLauncherIfLauncherIsDebugAndRunInProgress()
        {
            var mockCustomLauncher = new Mock <ITestHostLauncher>();

            testRunCriteria = new TestRunCriteria(new List <string> {
                "foo"
            }, 1, false, null, TimeSpan.Zero, mockCustomLauncher.Object);
            executionManager = new Mock <IProxyExecutionManager>();
            testRunRequest   = new TestRunRequest(testRunCriteria, executionManager.Object);

            testRunRequest.ExecuteAsync();

            var testProcessStartInfo = new TestProcessStartInfo();

            mockCustomLauncher.Setup(ml => ml.IsDebug).Returns(true);
            testRunRequest.LaunchProcessWithDebuggerAttached(testProcessStartInfo);

            mockCustomLauncher.Verify(ml => ml.LaunchTestHost(testProcessStartInfo), Times.Once);
        }