Testing

Testing the boundaries of your Web APIs

How do you make sure an entire software you wrote works? And how would you do that if your system doesn’t have a UI? Well, simply by testing the boundaries of course! From time to time I like to extract pieces of code from what I’m working on and create small repos just to showcase […]

Unit, integration, end-to-end tests: do I need all of them?

Yes. I mean, don’t even think about it. You’ll need all of them, probably in different measures, but there is no “we shipped to production without tests”. Tests are the first rampart separating you from madness and failure. Why madness? Try to do even a small refactoring after you’ve deployed your app. Without automatic tests […]

How to reset the entities state on a Entity Framework Db Context

I had two bad days. Those days wasted chasing a stupid bug. I had a test class with 4 test cases on my infrastructure layer. If executed one by one, they pass. If the whole suite was executed, only the first one was passing. At the end I found out that it was due to […]

Unit testing MongoDB in C# part 4: the tests, finally

More than a year. Wow, that’s a lot, even for me! In the last episode of this series, we discussed about how to create the Factories for our Repositories. I guess now it’s time to put a use to all those interfaces and finally see how to unit test our MongoDB repositories 🙂 Remember: we […]

CQRS: on Commands and Validation

Let’s have a quick discussion about CQRS. There’s a lot to say to be honest, so let’s try to focus on just one thing today: validating your Commands (who knows, I could start a series after this, we’ll see). The idea is simple: how can I make sure that the data I am passing to […]

Scroll to top