Skip to content

Commit de5d54b

Browse files
committed
fix: test name and network hardcoded name
1 parent a5116e2 commit de5d54b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/Testcontainers.EventHubs.Tests/EventHubsContainerTest.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
using System;
2+
using Azure.Messaging.EventHubs.Consumer;
3+
14
namespace Testcontainers.EventHubs;
25

36
public abstract class EventHubsContainerTest : IAsyncLifetime
@@ -6,9 +9,8 @@ public abstract class EventHubsContainerTest : IAsyncLifetime
69

710
private EventHubsContainer _eventHubsContainer;
811

9-
private readonly INetwork _network = new NetworkBuilder().WithName(NetworkName).Build();
12+
private readonly INetwork _network = new NetworkBuilder().Build();
1013

11-
private const string NetworkName = "eh-network";
1214
private const string AzuriteNetworkAlias = "azurite";
1315

1416
private const string EventHubName = "testeventhub";
@@ -28,9 +30,10 @@ public async Task InitializeAsync()
2830

2931
var configurationBuilder = ConfigurationBuilder
3032
.Create()
31-
.WithEventHub(EventHubName, "2", new[] { EventHubConsumerGroupName });
33+
.WithEventHub(EventHubName, 2, [EventHubConsumerGroupName]);
3234

3335
var builder = new EventHubsBuilder()
36+
.WithAcceptLicenseAgreement(true)
3437
.WithNetwork(_network)
3538
.WithConfigurationBuilder(configurationBuilder)
3639
.WithAzuriteBlobEndpoint(AzuriteNetworkAlias)
@@ -50,9 +53,9 @@ public async Task DisposeAsync()
5053

5154
[Fact]
5255
[Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))]
53-
public async Task SendAndReceivesEvents()
56+
public async Task SendEvents()
5457
{
55-
// Give
58+
// Given
5659
var eventBody = Encoding.Default.GetBytes("test");
5760
var producerClient = new EventHubProducerClient(_eventHubsContainer.GetConnectionString(), EventHubName);
5861

0 commit comments

Comments
 (0)