Exemplo n.º 1
0
        public async Task Health_Get_Docker_Succeeds()
        {
            // Arrange
            Uri dockerBaseUrl         = _configuration.GetDockerBaseUrl();
            var healthEndpointService = new HealthEndpointService(dockerBaseUrl, _outputWriter);

            // Act
            HealthStatus status = await healthEndpointService.GetHealthAsync();

            // Assert
            Assert.Equal(HealthStatus.Healthy, status);
        }
        private ServiceBusWorkerProject(
            ServiceBusEntity entity,
            TestConfig configuration,
            ITestOutputHelper outputWriter)
            : base(configuration.GetServiceBusProjectDirectory(entity),
                   configuration.GetFixtureProjectDirectory(),
                   outputWriter)
        {
            _entity        = entity;
            _healthPort    = configuration.GenerateWorkerHealthPort();
            _configuration = configuration;

            Health      = new HealthEndpointService(_healthPort, outputWriter);
            MessagePump = new MessagePumpService(entity, configuration, outputWriter);
        }
Exemplo n.º 3
0
 private AzureFunctionsHttpProject(
     TestConfig configuration,
     ITestOutputHelper outputWriter)
     : base(configuration.GetAzureFunctionsHttpProjectDirectory(),
            configuration,
            outputWriter)
 {
     OrderFunctionEndpoint = RootEndpoint.AppendPathSegments("api", "v1", "order").ToUri();
     Order  = new OrderService(OrderFunctionEndpoint, outputWriter);
     Health = new HealthEndpointService(
         RootEndpoint.AppendPathSegments("api", "v1").ToUri(),
         outputWriter);
     Swagger = new SwaggerEndpointService(
         RootEndpoint.AppendPathSegments("api", "swagger", "ui"),
         RootEndpoint.AppendPathSegments("api", "swagger.json"),
         outputWriter);
 }
Exemplo n.º 4
0
        public async Task Health_Get_Docker_Succeeds()
        {
            // Arrange
            Uri dockerBaseUrl         = _configuration.GetDockerBaseUrl();
            var healthEndpointService = new HealthEndpointService(dockerBaseUrl, _outputWriter);

            // Act
            using (HttpResponseMessage response = await healthEndpointService.GetAsync())
            {
                // Assert
                Assert.Equal(HttpStatusCode.OK, response.StatusCode);
                string healthReportJson = await response.Content.ReadAsStringAsync();

                var healthReport = JsonConvert.DeserializeObject <HealthReport>(healthReportJson, new TimeSpanConverter());
                Assert.NotNull(healthReport);
                Assert.Equal(HealthStatus.Healthy, healthReport.Status);
            }
        }
Exemplo n.º 5
0
        private WebApiProject(
            Uri baseUrl,
            TestConfig configuration,
            DirectoryInfo templateDirectory,
            DirectoryInfo fixturesDirectory,
            ITestOutputHelper outputWriter)
            : base(templateDirectory, fixturesDirectory, outputWriter)
        {
            Guard.NotNull(baseUrl, nameof(baseUrl), "Cannot create a web API services without a test configuration");
            Guard.NotNull(configuration, nameof(configuration), "Cannot create a web API project without a configuration that describes startup settings");
            Guard.NotNull(outputWriter, nameof(outputWriter), "Cannot create a web API project without a test logger that sends diagnostic messages during the creation of the project");

            _baseUrl       = baseUrl;
            _configuration = configuration;

            Health  = new HealthEndpointService(baseUrl, outputWriter);
            Swagger = new SwaggerEndpointService(baseUrl, outputWriter);
            Root    = new RootEndpointService(baseUrl, outputWriter);
        }