Skip to main content

New answers tagged

6 votes
Accepted

How to name uppercase variables when using the camelCase convention?

At least going by .NET naming guidelines, you should use _apiEndpoint if it is a field or ApiEndpoint if it is a property. Quoting from the link: The PascalCasing convention, used for all identifiers ...
JMekker's user avatar
  • 257
1 vote
Accepted

Reduce Code Repetition for a Simple CQRS

Stating the bleeding obvious here: promoting reusability entails introducing an additional abstraction which allows for said reuse. Less obvious is that there's a difference between theoretical ...
Flater's user avatar
  • 53k
1 vote
Accepted

.Net 8 XUnit: How to mock MySql in a CQRS API using integration tests?

OK so to summarise the EF tests Lab setup is not shown. But we can see a WebApplicationFactory is passed in and the IVdcRepository<Job> implementation is extracted from the DI container and the ...
Ewan's user avatar
  • 77.5k
1 vote

.Net 8 XUnit: How to mock MySql in a CQRS API using integration tests?

What I ended up doing is to mock the interface who has the MySql methods and inject the expected data from the Lab class, then in the test I call the controller and compare result with the result get ...
Diego Perez's user avatar
1 vote

.Net 8 XUnit: How to mock MySql in a CQRS API using integration tests?

Integration test use real data and real databases to ensure that your components communicate across boundaries. If you are doing an integration test, you need to figure out how to make that work, not ...
jmoreno's user avatar
  • 11k
4 votes

.Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS?

Given that we have easy spin up of databases in containers these days I think the best solution for testing is to spin up a real database and throw it away afterwards. You can go further and use ...
Ewan's user avatar
  • 77.5k
4 votes
Accepted

.Net 8 XUnit: Should my tests use real data or how to mock MySql with CQRS?

The answer here is as often "depends what you're trying to test". If you're trying to unit test an edge case (e.g. that the application does not crash if the query errors), you almost ...
Philip Kendall's user avatar

Top 50 recent answers are included