Unit tests for microservices


There are no unit tests written for it. Are there any reasons for it?


No special reason, eventually we will add some tests, for now, we have focused on the core functionality and making the solution work.


You know developers don’t like writing tests. :slight_smile:


Thanks for the update!


I can understand! :grinning:


Yeah, well, it’s not like we don’t like testing, it’s just that there were more urgent things to do :wink:.


Are you guys open to receive PRs to get those tests in place?


Yes, any additional help would be really appreciated!
Basically, our approach (at least for now), is to have 2 separate test projects under tests directory e.g. tests/DShop.Api.Test and tests/DShop.Api.Test.EndToEnd.
The first one would be basic unit tests, for example using xUnit, Moq, FluentAssertions, Fixture etc. and the second one would be sort of a integration/e2e tests using ASP.NET Core Test Server library.


So the direction you want to take is XUnit, Moq, and FluentAssertions. What other standards are you wanting to set? With some coordinated standards we can get some things moving forward.


It’s not mandatory - these are the libraries that we use on a daily basis, however, feel free to use something else. I think that we’d like to stick to xUnit as the testing framework and FluentAssertions (or something similar) to skip a static Assert.() code. The key is just to stay consistent :slight_smile:.