C
C#13mo 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ß13mo 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
JakenVeina13mo 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ß13mo ago
@ReactiveVeina question from me, would this be considered integration test then? or not because its only fake db?
JakenVeina
JakenVeina13mo 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ß13mo ago
aight 🙂
Accord
Accord13mo 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.