public void InitializePublisher(IExecutionContext context, string projectName, VssConnection connection, string testRunner, bool publishRunLevelAttachments)
 {
     Trace.Entering();
     _executionContext = context;
     _projectName      = projectName;
     _resultReader     = GetTestResultReader(testRunner, publishRunLevelAttachments);
     _testRunPublisher = HostContext.GetService <ITestRunPublisher>();
     _testRunPublisher.InitializePublisher(_executionContext, connection, projectName, _resultReader);
     Trace.Leaving();
 }
Esempio n. 2
0
 public void InitializePublisher(IExecutionContext context, string projectName, VssConnection connection, string testRunner, bool publishRunLevelAttachments)
 {
     Trace.Entering();
     _executionContext   = context;
     _projectName        = projectName;
     _testRunner         = testRunner;
     _resultReader       = GetTestResultReader(_testRunner, publishRunLevelAttachments);
     _testRunPublisher   = HostContext.GetService <ITestRunPublisher>();
     _featureFlagService = HostContext.GetService <IFeatureFlagService>();
     _testRunPublisher.InitializePublisher(_executionContext, connection, projectName, _resultReader);
     _calculateTestRunSummary = _featureFlagService.GetFeatureFlagState(TestResultsConstants.CalculateTestRunSummaryFeatureFlag, TestResultsConstants.TFSServiceInstanceGuid);
     Trace.Leaving();
 }
        private void SetupMocks([CallerMemberName] string name = "")
        {
            TestHostContext hc = new TestHostContext(this, name);

            _ec = new Mock <IExecutionContext>();
            List <string> warnings;
            var           variables = new Variables(hc, new Dictionary <string, VariableValue>(), out warnings);

            _ec.Setup(x => x.Variables).Returns(variables);

            hc.SetSingleton <ITestResultsServer>(_testResultServer.Object);

            _publisher = new TestRunPublisher();
            _publisher.Initialize(hc);
            _publisher.InitializePublisher(_ec.Object, new VssConnection(new Uri("http://dummyurl"), new Common.VssCredentials()), "Project1", _reader.Object);
        }
        private void SetupMocks([CallerMemberName] string name = "")
        {
            TestHostContext hc = new TestHostContext(this, name);
            _ec = new Mock<IExecutionContext>();
            List<string> warnings;
            var variables = new Variables(hc, new Dictionary<string, string>(), new List<MaskHint>(), out warnings);
            _ec.Setup(x => x.Variables).Returns(variables);

            hc.SetSingleton<ITestResultsServer>(_testResultServer.Object);

            _publisher = new TestRunPublisher();
            _publisher.Initialize(hc);
            _publisher.InitializePublisher(_ec.Object, new Client.VssConnection(new Uri("http://dummyurl"), new Common.VssCredentials()), "Project1", _reader.Object);
        }