public void Stop_EndsTheService()
        {
            // Arrange
            var maxDurationInMilliseconds = AgentCoordinationService.AgentControlDefinitionCheckIntervalInMilliseconds * 3;
            var agentConfigurationProvider = new Mock<IAgentControlDefinitionProvider>();

            var agentControlDefinition = new AgentControlDefinition
            {
                AgentIsEnabled = true,
                Hostaddress = "127.0.0.1",
                Hostname = "www.example.com",
                CheckIntervalInSeconds = AgentCoordinationService.AgentControlDefinitionCheckIntervalInMilliseconds,
                SystemInformationSenderPath = "/api/systeminformation"
            };
            agentConfigurationProvider.Setup(a => a.GetControlDefinition()).Returns(agentControlDefinition);

            var agentCoordinationService = new AgentCoordinationService(agentConfigurationProvider.Object, () => { }, () => { });

            // Act
            var stopwatch = new Stopwatch();
            stopwatch.Start();

            var agentCoordinationServiceTask = new Task(agentCoordinationService.Start);
            agentCoordinationServiceTask.Start();
            Thread.Sleep(500);
            agentCoordinationService.Stop();
            Task.WaitAll(new[] { agentCoordinationServiceTask }, maxDurationInMilliseconds);

            stopwatch.Stop();

            // Assert
            Assert.Less(stopwatch.ElapsedMilliseconds, maxDurationInMilliseconds);
        }