Respawn
testhelper.mod
Respawn | testhelper.mod | |
---|---|---|
9 | 2 | |
2,518 | 2 | |
- | - | |
3.4 | 3.5 | |
3 days ago | 8 months ago | |
C# | Go | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Respawn
- Respawn: Intelligent database cleaner for integration tests
-
C# Tests failing using XUnit and EF InMemoryDatabase
ImMemoryDb isnt recommended for testing as it doesnt behave as a real database. Save yourself trouble and use a real database paired with Respawn.
-
Testing survey
I come from a .NET background and in the .NET environment I used to seed the database with the necessary data on each test and then clean the database at the end of the test using the Respawn library.
-
Opinions regarding move to TDD-focused employer
This was our initial approach (using sqlite) but our migrations take a while to run and this resulted in slow tests. Using Respawn to clean the db significantly improved test performance (https://github.com/jbogard/Respawn)
- [Parte 8] ASP.NET Core: Integration Tests
-
Pain & Gain of automated tests against SQL
Have you used something like Respwan https://github.com/jbogard/Respawn instead of creating and cleaning or deleting database every time? Not sure if it would help you. But I thought it might make your workflow little simpler. Respawn lets to restore db to a restore point.
-
share one RazorPage application of CleanArchitecture Project
NUnit, FluentAssertions, Moq & Respawn
- Swapping MSSQL provider for SQLite for testing?
-
Integration testing Api
You will need a separate test database purely for integration tests. You will need to reset the state of the DB every time using something like https://github.com/jbogard/Respawn. I always use the (localdb)\mssqllocal SQL instance that comes as standard with VS for dev and integration test databases.
testhelper.mod
-
Testing survey
The standard Go testing environment is very good, certainly for unit testing. You might want to use some test helper packages to provide some missing features. For instance, table-driven testing where you have a table of test-specific structures providing inputs and expected results which you iterate over, is a good way of organising your tests. One downside is that the test failure will all be reported from the same line and it can be hard to find the failing test. A useful helper to identify the failing test is the ID struct from github.com/nickwells/testhelper.mod/v2/testhelper which if created using the MkID function will show the filename and line of the failing test. This package also offers standardised comparison checks and support for Golden files and lots more.
-
testhelper v1.16.0 released with a new DiffVals func - like reflect.DeepEqual but with some useful extra features
You can get the testhelper package with
What are some alternatives?
NUnit - NUnit Framework
ezcli - ✨ Minimal Go package for create CLI tools in <10 second!
EntityFramework.Docs - Documentation for Entity Framework Core and Entity Framework 6
ContosoUniversityDotNetCore-Pages - With Razor Pages
CleanArchitectureCodeGenerator - Generate the application features code class that conforms to the CQRS design pattern in the Application project - Visual Studio.net 2022 Extensions plugin
Brighter - A framework for building messaging apps with .NET and C#.
DbSample - Example of automated tests against SQL Server with EF Core
MinimalApiArchitecture - .NET 8 Minimal API with Vertical Slice Architecture
FluentValidation - A popular .NET validation library for building strongly-typed validation rules.
Fluent Assertions - A very extensive set of extension methods that allow you to more naturally specify the expected outcome of a TDD or BDD-style unit tests. Targets .NET Framework 4.7, as well as .NET Core 2.1, .NET Core 3.0, .NET 6, .NET Standard 2.0 and 2.1. Supports the unit test frameworks MSTest2, NUnit3, XUnit2, MSpec, and NSpec3.
AspNetCoreMediatRExample - ASP.NET Demo usado en mi blog https://dev.to/isaacOjeda