|
|
|
|
|
by ericHosick
1387 days ago
|
|
> I extract method in scala code and just test that logic as part of development lifecycle. There is no dependency on a database. Unit testing seems to depend on where the unit of code is which is being tested. At the middle tier, you may mock out parts of the code so the tests aren't reliant on external sources (apis, databases, libraries, etc.). It seems that unit testing database code would happen at the database layer: it's still a unit test as the test isn't dependent on external sources. |
|
Its not database code though. "Orders over 100$ should be marked as vip" is domain logic.
Database code like interactions with database, connection pools, primary/secondary switching ect yes they should be tested with a database.