Data Annotation validation with dependency injection in a business service

What I love a about data annotations and validation attributes, is that the validation rules are defined very close to the class: when you open it up, you can view all the rules. The ApiController will even automatically do model validation. This is great, but I like some defense it depth; I want to be able to use those validations in my business service as well. I should not have to trust input. Let’s explore how we can make that happen.

Read the article Data Annotation validation with dependency injection in a business service

Kiota Client Unit Testing: mocking data

After implementing Kiota clients with resilience, I felt the need to spend some time on unit testing them. The Kiota docs on unit testing uses NSubstitute to override the response of the adapter. After some testing (pun intended), I did not feel satisfied with the results; we should be able to use the “normal” way of testing an HttpClient, right? In this blog, I’ll show how to use the RichardSzalay.MockHttp package together with Kiota.

Read the article Kiota Client Unit Testing: mocking data
expand_less brightness_auto