Skip to content

Commit

Permalink
chore: Removed duplicated AzuriteAccess
Browse files Browse the repository at this point in the history
  • Loading branch information
samtrion committed Dec 16, 2024
1 parent 81cc327 commit 5240999
Show file tree
Hide file tree
Showing 24 changed files with 68 additions and 340 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ await RunAndVerify(
[Fact]
public async Task AddKafka_UseConfigurationCreate_ShouldReturnHealthy() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddKafka("TestContainerHealthy");
},
healthChecks => _ = healthChecks.AddKafka("TestContainerHealthy"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand All @@ -90,10 +87,7 @@ await RunAndVerify(
[Fact]
public async Task AddKafka_UseConfigurationServiceProvider_ShouldReturnHealthy() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddKafka("TestContainerHealthy");
},
healthChecks => _ = healthChecks.AddKafka("TestContainerHealthy"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand Down Expand Up @@ -145,10 +139,7 @@ await RunAndVerify(healthChecks =>
[Fact]
public async Task AddKafka_UseConfigurationCreate_EnableDeliveryReportsFalse_ShouldReturnHealthy() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddKafka("TestContainerHealthy");
},
healthChecks => _ = healthChecks.AddKafka("TestContainerHealthy"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand Down Expand Up @@ -217,10 +208,7 @@ await RunAndVerify(
[Fact]
public async Task AddKafka_UseConfigurationCreate_ShouldReturnDegraded() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddKafka("TestContainerDegraded");
},
healthChecks => _ = healthChecks.AddKafka("TestContainerDegraded"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand All @@ -240,10 +228,7 @@ await RunAndVerify(
[Fact]
public async Task AddKafka_UseConfigurationServiceProvider_ShouldReturnDegraded() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddKafka("TestContainerDegraded");
},
healthChecks => _ = healthChecks.AddKafka("TestContainerDegraded"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand Down Expand Up @@ -295,10 +280,7 @@ await RunAndVerify(healthChecks =>
[Fact]
public async Task AddKafka_UseConfigurationCreate_EnableDeliveryReportsFalse_ShouldReturnDegraded() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddKafka("TestContainerDegraded");
},
healthChecks => _ = healthChecks.AddKafka("TestContainerDegraded"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace NetEvolve.HealthChecks.Tests.Integration.Azure.Blobs;
namespace NetEvolve.HealthChecks.Tests.Integration.Azure;

using System;
using System.Diagnostics.CodeAnalysis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ await RunAndVerify(
options.ContainerName = "test";
options.Mode = BlobClientCreationMode.ServiceProvider;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
},
Expand Down Expand Up @@ -178,9 +176,7 @@ await RunAndVerify(healthChecks =>
options.Mode = BlobClientCreationMode.SharedKey;
options.ServiceUri = _uriBlobStorage;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ await RunAndVerify(
{
_ = healthChecks.AddBlobServiceAvailability(
"ServiceServiceProviderHealthy",
options =>
{
options.Mode = BlobClientCreationMode.ServiceProvider;
}
options => options.Mode = BlobClientCreationMode.ServiceProvider
);
},
serviceBuilder: services =>
Expand All @@ -66,9 +63,7 @@ await RunAndVerify(
{
options.Mode = BlobClientCreationMode.ServiceProvider;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
},
Expand Down Expand Up @@ -144,9 +139,7 @@ await RunAndVerify(healthChecks =>
options.Mode = BlobClientCreationMode.SharedKey;
options.ServiceUri = _uriBlobStorage;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
});
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ await RunAndVerify(
options.QueueName = "test";
options.Mode = QueueClientCreationMode.ServiceProvider;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
},
Expand Down Expand Up @@ -179,9 +177,7 @@ await RunAndVerify(healthChecks =>
options.Mode = QueueClientCreationMode.SharedKey;
options.ServiceUri = _uriQueueStorage;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ await RunAndVerify(
{
_ = healthChecks.AddQueueServiceAvailability(
"ServiceServiceProviderHealthy",
options =>
{
options.Mode = QueueClientCreationMode.ServiceProvider;
}
options => options.Mode = QueueClientCreationMode.ServiceProvider
);
},
serviceBuilder: services =>
Expand All @@ -66,9 +63,7 @@ await RunAndVerify(
{
options.Mode = QueueClientCreationMode.ServiceProvider;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
},
Expand Down Expand Up @@ -144,9 +139,7 @@ await RunAndVerify(healthChecks =>
options.Mode = QueueClientCreationMode.SharedKey;
options.ServiceUri = _uriQueueStorage;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
});
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ await RunAndVerify(
options.TableName = "test";
options.Mode = TableClientCreationMode.ServiceProvider;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
},
Expand Down Expand Up @@ -202,9 +200,7 @@ await RunAndVerify(healthChecks =>
options.Mode = TableClientCreationMode.SharedKey;
options.ServiceUri = _uriTableStorage;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ await RunAndVerify(
{
_ = healthChecks.AddTableServiceAvailability(
"ServiceServiceProviderHealthy",
options =>
{
options.Mode = TableClientCreationMode.ServiceProvider;
}
options => options.Mode = TableClientCreationMode.ServiceProvider
);
},
serviceBuilder: services =>
Expand All @@ -58,9 +55,7 @@ await RunAndVerify(
{
options.Mode = TableClientCreationMode.ServiceProvider;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
},
Expand Down Expand Up @@ -136,9 +131,7 @@ await RunAndVerify(healthChecks =>
options.Mode = TableClientCreationMode.SharedKey;
options.ServiceUri = _uriTableStorage;
options.ConfigureClientOptions = clientOptions =>
{
clientOptions.Retry.MaxRetries = 0;
};
}
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ await RunAndVerify(healthChecks =>
{
_ = healthChecks.AddClickHouse(
"TestContainerHealthy",
options =>
{
options.ConnectionString = _database.ConnectionString;
}
options => options.ConnectionString = _database.ConnectionString
);
});

Expand Down Expand Up @@ -77,10 +74,7 @@ await RunAndVerify(healthChecks =>
[Fact]
public async Task AddClickHouse_UseConfiguration_ShouldReturnHealthy() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddClickHouse("TestContainerHealthy");
},
healthChecks => _ = healthChecks.AddClickHouse("TestContainerHealthy"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand All @@ -97,10 +91,7 @@ await RunAndVerify(
[Fact]
public async Task AddClickHouse_UseConfiguration_ShouldReturnDegraded() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddClickHouse("TestContainerDegraded");
},
healthChecks => _ = healthChecks.AddClickHouse("TestContainerDegraded"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand All @@ -118,10 +109,7 @@ await RunAndVerify(
[Fact]
public async Task AddClickHouse_UseConfigration_ConnectionStringEmpty_ThrowException() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddClickHouse("TestNoValues");
},
healthChecks => _ = healthChecks.AddClickHouse("TestNoValues"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand All @@ -135,10 +123,7 @@ await RunAndVerify(
[Fact]
public async Task AddClickHouse_UseConfigration_TimeoutMinusTwo_ThrowException() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddClickHouse("TestNoValues");
},
healthChecks => _ = healthChecks.AddClickHouse("TestNoValues"),
config =>
{
var values = new Dictionary<string, string?>(StringComparer.Ordinal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@ public class ApplicationHealthyCheckTests : HealthCheckTestBase
{
[Fact]
public async Task AddApplicationHealthy_ShouldReturnHealthy() =>
await RunAndVerify(healthChecks =>
{
_ = healthChecks.AddApplicationHealthy();
});
await RunAndVerify(healthChecks => _ = healthChecks.AddApplicationHealthy());
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ public class ApplicationReadyCheckTests : HealthCheckTestBase
{
[Fact]
public async Task AddApplicationReady_ShouldReturnHealthy() =>
await RunAndVerify(healthChecks =>
{
_ = healthChecks.AddApplicationReady();
});
await RunAndVerify(healthChecks => _ = healthChecks.AddApplicationReady());

[Fact]
public async Task AddApplicationReady_WithCustomName_ShouldReturnHealthy() =>
await RunAndVerify(
healthChecks =>
{
_ = healthChecks.AddApplicationReady();
},
healthChecks => _ = healthChecks.AddApplicationReady(),
serverConfiguration: server =>
{
var lifetime = server.Services.GetRequiredService<IHostApplicationLifetime>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ protected async ValueTask RunAndVerify(
)
{
var builder = new WebHostBuilder()
.ConfigureAppConfiguration(
(_, configBuilder) =>
{
config?.Invoke(configBuilder);
}
)
.ConfigureAppConfiguration((_, configBuilder) => config?.Invoke(configBuilder))
.ConfigureServices(services =>
{
serviceBuilder?.Invoke(services);
Expand Down
Loading

0 comments on commit 5240999

Please sign in to comment.