❔ 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
but the Country class doesn't have create, update, delete functionality 🤔 do you maybe wanna test your CountryRepository and/or CountryController class instead?
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
@ReactiveVeina question from me, would this be considered integration test then? or not because its only fake db?
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
aight 🙂
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.