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
public class LocalStackFixture : IAsyncLifetime | |
{ | |
private readonly TestcontainersContainer _localStackContainer; | |
public LocalStackFixture() | |
{ | |
var localStackBuilder = new TestcontainersBuilder<TestcontainersContainer>() | |
.WithImage("localstack/localstack") | |
.WithCleanUp(true) | |
.WithEnvironment("DEFAULT_REGION", "eu-central-1") |
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
{ | |
"QueueUrls": [ | |
"http://localhost:4566/000000000000/ArmutLocalStack-Test-DLQ.fifo", | |
"http://localhost:4566/000000000000/ArmutLocalStack-Test.fifo" | |
] | |
} |
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
awslocal sqs receive-message --queue-url http://localhost:4566/000000000000/ArmutLocalStack-Test.fifo |
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
awslocal sqs list-queues |
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
awslocal dynamodb scan --table-name Movies |
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
awslocal dynamodb list-tables |
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
public abstract class BaseScenario | |
{ | |
protected internal readonly TestServer TestServer; | |
protected internal readonly HttpClient HttpClient; | |
internal readonly IDynamoDBContext DynamoDbContext; | |
internal readonly IAmazonSQS SqsClient; |
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
[Collection(nameof(ApiTestCollection))] | |
public class MovieScenarios : BaseScenario | |
{ | |
public MovieScenarios(TestServerFixture testServerFixture) : base(testServerFixture) | |
{ | |
} | |
[Fact] | |
public async Task AddMovie_Should_Return_400_From_ServiceValidation() |
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
public class MovieRepository : Repository<MovieEntity>, IMovieRepository | |
{ | |
public MovieRepository(IDynamoDBContext context) : base(context) | |
{ | |
} | |
public async Task<MovieEntity> GetMovieByIdAsync(Guid movieId, CancellationToken token = default) | |
{ | |
DynamoDBOperationConfig operationConfig = new DynamoDBOperationConfig | |
{ |
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
public interface IRepository<TModel> | |
{ | |
Task<Document> AddAsync(TModel model, CancellationToken token = default); | |
} | |
public abstract class Repository<TModel> : IRepository<TModel> | |
{ | |
protected readonly IDynamoDBContext _context; | |
protected readonly Table _table; |
NewerOlder