Пример #1
0
        // [Test]
        public void GetExecutionListAgentsDetails_WhenExecuted_ShouldReturnAgentsExecutionResult()
        {
            //Arrange
            var executionAgent = new AgentDataService("SkyNetPortalDB");

            //Act
            var actual = executionAgent.GetExecutedListAgentDetails();

            var actualFirstAndLast = new List <AgentExecution>
            {
                actual.First(),
                actual.Last()
            };

            //Assert
            var expectedFirst = new List <AgentExecution>
            {
                new AgentExecution
                {
                    ExecutionId   = 1,
                    Command       = "ip",
                    Result        = "193.192.2.194",
                    ExecutionTime = DateTime.Parse("2018-12-31 23:59:59")
                },
                new AgentExecution
                {
                    ExecutionId   = 2,
                    Command       = "hostname",
                    Result        = "DevFluence7",
                    ExecutionTime = DateTime.Parse("2018-01-01 21:59:59")
                }
            };

            actualFirstAndLast.Should().BeEquivalentTo(expectedFirst);
        }
Пример #2
0
 public void GetAgentHistory()
 {
     Get["/agentHistory"] = _ =>
     {
         var agentService = new AgentDataService("LocalHost");
         var getAllAgent  = agentService.GetAgents();
         return(Negotiate.WithStatusCode(HttpStatusCode.OK)
                .WithModel(getAllAgent));
     };
 }
Пример #3
0
        // [Test]
        public void GetExecutionListAgentsDetails_WhenExecuted_ShouldReturnAllAgentsExecutionResult()
        {
            //Arrange
            var executionAgent = new AgentDataService("SkyNetPortalDB");

            //Act
            var agents = executionAgent.GetExecutedListAgentDetails();

            //Assert
            Assert.AreEqual(2, agents.Count());
        }