C
C#2y ago
krugera

❔ UnitTests, need help

Hello, I want to test this class for create, update, delete with unit tests without mocking framework. Could you give some advice?
6 Replies
Florian Voß
Florian Voß2y ago
but the Country class doesn't have create, update, delete functionality 🤔 do you maybe wanna test your CountryRepository and/or CountryController class instead?
JakenVeina
JakenVeina2y ago
if you don't want to use mocking/faking in your tests, by definition, you want to use the real data access mechanisms which means you need a real database one that's presumably not your PROD database, but instead contains data specifically for testing
Florian Voß
Florian Voß2y ago
@ReactiveVeina question from me, would this be considered integration test then? or not because its only fake db?
JakenVeina
JakenVeina2y ago
that can also, presumably, be reset after testing is complete, or before testing is run indeed it would, that's a good point "Unit" testing requires mocking and faking, by definition if you're testing units against other real units, instead of mocks or fakes, it's not a Unit test which is fine, just call it what it is
Florian Voß
Florian Voß2y ago
aight 🙂
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server