Пример #1
0
        public void UpdateTestProcessStartInfoShouldUpdateTelemetryOptedInArgFalseIfTelemetryOptedOut()
        {
            var mockRequestData = new Mock <IRequestData>();

            this.mockRequestData.Setup(rd => rd.IsTelemetryOptedIn).Returns(false);

            this.mockDataCollectionManager.Setup(x => x.BeforeTestRunStart(It.IsAny <bool>(), It.IsAny <bool>(), It.IsAny <ITestMessageEventHandler>())).Returns(DataCollectionParameters.CreateDefaultParameterInstance());

            var testProcessStartInfo = new TestProcessStartInfo();

            testProcessStartInfo.Arguments = string.Empty;

            var proxyExecutionManager = new TestableProxyExecutionManagerWithDataCollection(this.mockRequestData.Object, this.mockRequestSender.Object, this.mockTestHostManager.Object, this.mockDataCollectionManager.Object);

            // Act.
            proxyExecutionManager.UpdateTestProcessStartInfoWrapper(testProcessStartInfo);

            // Verify.
            Assert.IsTrue(testProcessStartInfo.Arguments.Contains("--telemetryoptedin false"));
        }
Пример #2
0
        public void UpdateTestProcessStartInfoShouldUpdateDataCollectionPortArg()
        {
            this.mockDataCollectionManager.Setup(x => x.BeforeTestRunStart(It.IsAny <bool>(), It.IsAny <bool>(), It.IsAny <ITestMessageEventHandler>())).Returns(DataCollectionParameters.CreateDefaultParameterInstance());

            var testProcessStartInfo = new TestProcessStartInfo();

            testProcessStartInfo.Arguments = string.Empty;

            var proxyExecutionManager = new TestableProxyExecutionManagerWithDataCollection(this.mockRequestSender.Object, this.mockTestHostManager.Object, this.mockDataCollectionManager.Object);

            proxyExecutionManager.UpdateTestProcessStartInfoWrapper(testProcessStartInfo);

            Assert.IsTrue(testProcessStartInfo.Arguments.Contains("--datacollectionport 0"));
        }