Skip to content

Commit

Permalink
chore: Update WeatherForecast example
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed May 24, 2023
1 parent eedd883 commit da7112c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions examples/WeatherForecast/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<Project>
<ItemGroup>
<PackageReference Update="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="all"/>
<PackageReference Update="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.13"/>
<PackageReference Update="Microsoft.EntityFrameworkCore" Version="6.0.13"/>
<PackageReference Update="Microsoft.Fast.Components.FluentUI" Version="2.0.3"/>
<PackageReference Update="Testcontainers.SqlEdge" Version="3.0.0"/>
<PackageReference Update="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.16"/>
<PackageReference Update="Microsoft.EntityFrameworkCore" Version="6.0.16"/>
<PackageReference Update="Microsoft.Fast.Components.FluentUI" Version="2.0.5"/>
<PackageReference Update="Testcontainers.SqlEdge" Version="3.2.0"/>
<PackageReference Update="System.ComponentModel.Annotations" Version="5.0.0"/>
<PackageReference Update="System.Text.Json" Version="6.0.7"/>
<PackageReference Update="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.13"/>
<PackageReference Update="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.16"/>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.4.1"/>
<PackageReference Update="Selenium.WebDriver.ChromeDriver" Version="106.0.5249.6100"/>
<PackageReference Update="Selenium.WebDriver" Version="4.8.0"/>
<PackageReference Update="Selenium.WebDriver" Version="4.9.1"/>
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5"/>
<PackageReference Update="xunit" Version="2.4.2"/>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public sealed class WeatherForecastContainer : HttpClient, IAsyncLifetime
{
private static readonly X509Certificate Certificate = new X509Certificate2(WeatherForecastImage.CertificateFilePath, WeatherForecastImage.CertificatePassword);

private static readonly WeatherForecastImage Image = new();
private static readonly WeatherForecastImage Image = new WeatherForecastImage();

private readonly INetwork _weatherForecastNetwork;

Expand Down Expand Up @@ -57,7 +57,6 @@ public WeatherForecastContainer()

public async Task InitializeAsync()
{
// It is not necessary to clean up resources immediately (still good practice). The Resource Reaper will take care of orphaned resources.
await Image.InitializeAsync()
.ConfigureAwait(false);

Expand All @@ -73,6 +72,7 @@ await _weatherForecastContainer.StartAsync()

public async Task DisposeAsync()
{
// It is not necessary to clean up resources immediately (still good practice). The Resource Reaper will take care of orphaned resources.
await Image.DisposeAsync()
.ConfigureAwait(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class WeatherForecastImage : IImage, IAsyncLifetime

public const string CertificatePassword = "password";

private readonly SemaphoreSlim _semaphoreSlim = new(1, 1);
private readonly SemaphoreSlim _semaphoreSlim = new SemaphoreSlim(1, 1);

private readonly IImage _image = new DockerImage("localhost/testcontainers", "weather-forecast", DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task Get_WeatherForecast_ReturnsSevenDays()

public sealed class Web : IClassFixture<WeatherForecastContainer>
{
private static readonly ChromeOptions ChromeOptions = new();
private static readonly ChromeOptions ChromeOptions = new ChromeOptions();

private readonly WeatherForecastContainer _weatherForecastContainer;

Expand Down

0 comments on commit da7112c

Please sign in to comment.