Exemple #1
0
        public void Activate_NoEnvironmentArgs_InactiveAgent()
        {
            // Act
            var agent = RemoteAgentActivator.TryActivate();

            // Assert
            Assert.IsNull(agent);
        }
    private void Start()
    {
        const bool NOT_CONNECTED = false;

        _connectionIndicator.DisplayStatus(NOT_CONNECTED);
        var args = new[] { RemoteAgentActivator.VERBOSE_ACTIVATION_ARGUMENT_ARG };

        _host = RemoteAgentActivator.TryActivate(args);
        _host.OnConnectionChanged += _connectionIndicator.DisplayStatus;
    }
Exemple #3
0
        public void RemoteAgent_ArgumentsProvided_ActivatesAgent(
            [Values(
                 new[] { RemoteAgentActivator.ACTIVATION_ARGUMENT_ARG },
                 new[] { RemoteAgentActivator.VERBOSE_ACTIVATION_ARGUMENT_ARG })]
            string[] args
            )
        {
            // Act
            var agent = RemoteAgentActivator.TryActivate(args);

            // Assert
            Assert.IsNotNull(agent);
        }
Exemple #4
0
        public void RemoteAgent_IrreleventArgsProvided_DoesNotActivateAgent(
            [Values(
                 new[] { "-batchmode" },
                 new[] { "-projectPath" },
                 new[] { "-projectPath", "-batchmode" })]
            string[] args
            )
        {
            // Act
            var agent = RemoteAgentActivator.TryActivate(args);

            // Assert
            Assert.IsNull(agent);
        }
Exemple #5
0
        public void RemoteAgent_ActivatedTwice_OnlyActivatesOnce()
        {
            // Arrange
            var firstActivatedAgent = RemoteAgentActivator
                                      .TryActivate(new[] { RemoteAgentActivator.ACTIVATION_ARGUMENT_ARG });

            // Act
            var secondActivatedAgent = RemoteAgentActivator
                                       .TryActivate(new[] { RemoteAgentActivator.VERBOSE_ACTIVATION_ARGUMENT_ARG });

            // Assert
            Assert.AreEqual(
                firstActivatedAgent.GetHashCode(),
                secondActivatedAgent.GetHashCode());
        }