Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update WeatherForecast example #904

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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