Skip to content

Commit

Permalink
Fix compilation warnings (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
inikulshin authored Dec 22, 2023
1 parent bffc080 commit 1eb64ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public async Task<string> CreateContainerAsync(
string image,
string name,
IDictionary<string, ISet<string>> portMappings,
string networkName = null,
IList<string> envVars = null,
string? networkName = null,
IList<string>? envVars = null,
CancellationToken token = default
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>

<AssemblyOriginatorKeyFile>..\..\Assets\EasyNetQ.snk</AssemblyOriginatorKeyFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed class RabbitMqFixture : IAsyncLifetime, IDisposable
private readonly string tag;
private readonly DockerProxy dockerProxy;
private OSPlatform dockerEngineOsPlatform;
private string dockerNetworkName;
private string? dockerNetworkName;

public RabbitMqFixture()

Check warning on line 19 in Source/EasyNetQ.Management.Client.IntegrationTests/RabbitMQFixture.cs

View workflow job for this annotation

GitHub Actions / Lint & Tests

Non-nullable property 'ManagementClient' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 19 in Source/EasyNetQ.Management.Client.IntegrationTests/RabbitMQFixture.cs

View workflow job for this annotation

GitHub Actions / Lint & Tests

Non-nullable property 'RabbitmqVersion' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 19 in Source/EasyNetQ.Management.Client.IntegrationTests/RabbitMQFixture.cs

View workflow job for this annotation

GitHub Actions / Integrations Tests (3.10)

Non-nullable property 'ManagementClient' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 19 in Source/EasyNetQ.Management.Client.IntegrationTests/RabbitMQFixture.cs

View workflow job for this annotation

GitHub Actions / Integrations Tests (3.10)

Non-nullable property 'RabbitmqVersion' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 19 in Source/EasyNetQ.Management.Client.IntegrationTests/RabbitMQFixture.cs

View workflow job for this annotation

GitHub Actions / Integrations Tests (3.11)

Non-nullable property 'ManagementClient' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 19 in Source/EasyNetQ.Management.Client.IntegrationTests/RabbitMQFixture.cs

View workflow job for this annotation

GitHub Actions / Integrations Tests (3.11)

Non-nullable property 'RabbitmqVersion' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
{
Expand Down Expand Up @@ -66,13 +66,13 @@ private async Task DisposeAsync(CancellationToken cancellationToken)
{
await dockerProxy.StopContainerAsync(ContainerName, cancellationToken);
await dockerProxy.RemoveContainerAsync(ContainerName, cancellationToken);
if (dockerEngineOsPlatform == OSPlatform.Linux || dockerEngineOsPlatform == OSPlatform.OSX)
if (dockerNetworkName != null)
await dockerProxy.DeleteNetworkAsync(dockerNetworkName, cancellationToken);
}

private async Task CreateNetworkAsync(CancellationToken cancellationToken)
{
if (dockerEngineOsPlatform == OSPlatform.Linux || dockerEngineOsPlatform == OSPlatform.OSX)
if (dockerNetworkName != null)
await dockerProxy.CreateNetworkAsync(dockerNetworkName, cancellationToken);
}

Expand Down

0 comments on commit 1eb64ee

Please sign in to comment.