squadron
squadron copied to clipboard
A testing framework for containerized and cloud services
Squadron is a testing framework for containerized and cloud services.
Squadron is a helpful framework which enables you to write tests against dependent services without any overhead. Squadron can provide you isolation in tests through Container Providers or support for all other services through Cloud Providers.
To get more detailed information about Squadron, go to the Squadron Docs
Features
Container Providers
- [x] MongoDB
- [x] MongoDB ReplicaSet
- [x] SQL Server
- [x] Elasticsearch
- [x] Azure Blob and Queues
- [x] RabittMQ
- [x] Redis
- [x] PostgresSQL
- [ ] Kafka
- [x] RavenDB
- [x] MySQL
- [x] MariaDB
- [x] Neo4j
- [x] S3 with Minio
- [x] FtpServer with fauria/vsftpd
Cloud Providers
- [x] Azure Service Bus
- [x] Azure Event Hub
- [x] Azure Storage
Getting Started
As getting started we've prepared a simple example how to use Squadron with MongoDB.
You can find samples with quick starts here.
Install
Install the Squadron nuget package for MongoDB within your test project:
dotnet add package Squadron.Mongo
Access
Inject the MongoResource into your test class constructor:
public class AccountRepositoryTests
: IClassFixture<MongoResource>
{
private readonly MongoResource _mongoResource;
public AccountRepositoryTests(
MongoResource mongoResource)
{
_mongoResource = mongoResource;
}
}
Use
Use MongoResources to create a database and initialize your repository:
[Fact]
public void CreateAccount_AccountExists()
{
// arrange
var database = _mongoResource.CreateDatabase();
var accountRepository = new AccountRepository(database);
var account = new Account();
// act
var addedAccount = accountRepository.Add(account);
// assert
Snapshot.Match(addedAccount);
}
Community
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the Swiss Life OSS Code of Conduct.