public void PreloadAmazonElasticBeanstalk_With_Default_Arguments_Returns_Builder(bool stdoutEnabled) { // Arrange var mockBuilder = new Mock <IAndcultureCodeWebHostBuilder>(); // Act var result = IAndcultureCodeWebHostBuilderExtensions.PreloadAmazonElasticBeanstalk(mockBuilder.Object, stdoutEnabled); // Assert result.ShouldBe(mockBuilder.Object); }
public void PreloadAmazonElasticBeanstalk_When_Contains_AspNetCore_Environment_Sets_Global_EnvironmentVariable() { // Arrange var expected = $"testValue{Random.Int()}"; var mockBuilder = new Mock <IAndcultureCodeWebHostBuilder>(); var mockProvider = new Mock <AmazonEBConfigurationProvider>(); mockProvider.Setup(e => e.Has(IAndcultureCodeWebHostBuilderExtensions.ASPNETCORE_ENVIRONMENT)).Returns(true); mockProvider.Setup(e => e.Get(IAndcultureCodeWebHostBuilderExtensions.ASPNETCORE_ENVIRONMENT)).Returns(expected); // Act var result = IAndcultureCodeWebHostBuilderExtensions.PreloadAmazonElasticBeanstalk( builder: mockBuilder.Object, stdoutEnabled: false, configurationProvider: mockProvider.Object ); // Assert result.ShouldNotBeNull(); Environment.GetEnvironmentVariable(IAndcultureCodeWebHostBuilderExtensions.ASPNETCORE_ENVIRONMENT).ShouldBe(expected); }