Esempio n. 1
0
        public void Success()
        {
            // Restart the service with with valid environment variables,
            // let it run for a vew seconds and verify that it actually
            // sent and received some queue messages.

            using (var service = CreateQueueService())
            {
                queueServiceFixture.Restart(() => service);
                Assert.True(queueServiceFixture.IsRunning);

                // Give the service some time to process some messages.

                NeonHelper.WaitFor(() => service.SentCount > 0 && service.ReceiveCount > 0, timeout: TimeSpan.FromSeconds(60));

                Assert.True(service.SentCount > 0);
                Assert.True(service.ReceiveCount > 0);

                // Signal the service to stop and verify that it returned [exitcode=0].

                service.Stop();
                Assert.Equal(0, service.ExitCode);
            }
        }
Esempio n. 2
0
        public async Task NoConfig()
        {
            // Restart the service without specifying a configuration variable
            // or file and verify that its endpoint returns the default response.

            var service = CreateService();

            fixture.Restart(() => service);
            Assert.True(fixture.IsRunning);

            var client = fixture.GetHttpClient();

            Assert.Equal("UNCONFIGURED", await client.GetStringAsync("/"));
        }