コード例 #1
0
        public async Task 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.

            var service = CreateQueueService();

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

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

            await Task.Delay(TimeSpan.FromSeconds(5));

            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);
        }
コード例 #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("/"));
        }