Комментарии:
This is a good video. I was curious if you had a video or GitHub page for unit testing the actual repository (mocking the DbSet) not testing the controller. I've found lots of content on unit testing the controller but finding an asynchronous create (post), edit (patch), delete EF Core unit that actually works testing the repo layer has been challenging.
ОтветитьI am not an expert but this does not make much sense. When you provide It.IsAny<Employee>() as a parameter to repo-level Post method, it's just a bogus test. What exactly is the test achieving?
ОтветитьДякую, друже, все максимально зрозуміло!
Ответитьthank you
ОтветитьHi! Your video helped me a lot! It took me a long time to figure out how to use moq when there are repositories, interfaces, controllers, context, etc. I have already managed to write tests for several methods of methods of the BanksController class.
I have a question that I haven't been able to find an answer to yet:( I understand how to use moq with methods that return values and how to make methods raise errors but.... how to use moq with methods that don't return values? I'm writing tests for the Delete method of BanksController class that calls DeleteBankAsync method (which returns nothing) of a BankRepository class. How can I skip that call or substitute it with some custom code? Something like "pass" in Python.
Thanks!
Exactly what I have been looking for all day long. Thank you 🙏
ОтветитьAmazing video my bro, well explained and to the point.
ОтветитьGood explanation!! . Simple and straightforward. Keep doing more videos.
ОтветитьThank you for this video. I feel that I could understand everything, that you was trying to explain in the video. Very good and clean tutorial.
Ответитьrepositories with ef)))
ОтветитьCould you also make a video about unit testing your repositories/services if possible? Thanks :)
ОтветитьAmazing video. Have you try/use NSubstitute vs Moq? Thanks.
ОтветитьAmazing and clean explanation. Congrats!!!
ОтветитьI am searching for this kind of video, Well explained 👍👍
ОтветитьExactly what I was looking for! Like your clear explanation!
ОтветитьThe tutorial is straightforward, but how can I test my repository methods? Or Service methods (business logic)?
ОтветитьThanks for this! Loved the autofixture it saved me some time creating mock db sets
ОтветитьThis video is my preferred way of unit testing, I hope you guys find it helpful and if you did please drop a LIKE on the video! :)
Do you guys use any other frameworks or libraries when unit testing? ide love to know, so drop a comment as well!