-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
knightbus-redis/tests/KnightBus.Redis.Tests.Integration/RedisSetup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Threading.Tasks; | ||
using NUnit.Framework; | ||
using Testcontainers.Redis; | ||
|
||
namespace KnightBus.Redis.Tests.Integration; | ||
|
||
[SetUpFixture] | ||
public class RedisSetup | ||
{ | ||
private static readonly RedisContainer Redis = new RedisBuilder() | ||
.WithImage("redis") | ||
.WithPortBinding(6380, 6379) | ||
.Build(); | ||
|
||
public static string ConnectionString; | ||
|
||
[OneTimeSetUp] | ||
public async Task OneTimeSetup() | ||
{ | ||
await Redis.StartAsync(); | ||
ConnectionString = Redis.GetConnectionString(); | ||
} | ||
|
||
[OneTimeTearDown] | ||
public async Task Teardown() | ||
{ | ||
await Redis.DisposeAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters