public void Discover_SingleAgent_ReturnsAgent() { // arrange var agentUri = new Uri(AgentConfiguration.AgentUrl); var connectionManager = new AgentConnectionManager(); // act IDeploymentAgent agent = connectionManager.Discover(agentUri); // assert Assert.That(agent.IsAlive(), Is.True); Assert.That(agent.Uri, Is.EqualTo(agentUri)); Assert.That(agent.MachineName, Is.EqualTo(Environment.MachineName)); Assert.That(agent.Version, Is.EqualTo(typeof(Program).Assembly.GetName().Version)); }
public void Discover_AllAgents_ReturnsListWithAgent() { // arrange var connectionManager = new AgentConnectionManager(); // act IEnumerable <IDeploymentAgent> discoveredAgents = connectionManager.Discover(); // assert IDeploymentAgent agent = discoveredAgents.FirstOrDefault(); Assert.That(agent, Is.Not.Null); Assert.That(agent.IsAlive(), Is.True); Assert.That(agent.Uri, Is.EqualTo(new Uri(AgentConfiguration.AgentUrl))); Assert.That(agent.MachineName, Is.EqualTo(Environment.MachineName)); Assert.That(agent.Version, Is.EqualTo(typeof(Program).Assembly.GetName().Version)); }