Skip to content

Instantly share code, notes, and snippets.

View oguzhancagliyan's full-sized avatar

Oğuzhan Çağlıyan oguzhancagliyan

View GitHub Profile
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")
{
"QueueUrls": [
"http://localhost:4566/000000000000/ArmutLocalStack-Test-DLQ.fifo",
"http://localhost:4566/000000000000/ArmutLocalStack-Test.fifo"
]
}
awslocal sqs receive-message --queue-url http://localhost:4566/000000000000/ArmutLocalStack-Test.fifo
awslocal sqs list-queues
awslocal dynamodb scan --table-name Movies
awslocal dynamodb list-tables
public abstract class BaseScenario
{
protected internal readonly TestServer TestServer;
protected internal readonly HttpClient HttpClient;
internal readonly IDynamoDBContext DynamoDbContext;
internal readonly IAmazonSQS SqsClient;
[Collection(nameof(ApiTestCollection))]
public class MovieScenarios : BaseScenario
{
public MovieScenarios(TestServerFixture testServerFixture) : base(testServerFixture)
{
}
[Fact]
public async Task AddMovie_Should_Return_400_From_ServiceValidation()
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
{
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;