I am trying to create unit tests for a graph extension that I’ve developed for ARInvoiceEntry. The business logic depends on the cash account used. So we query the database for the cash account to get all the fields of the CashAccount DAC and its DAC extension. Then depending on the values of the field in CashAccount, the logic will set values in ARRegister. I am stuck on how to set up the ARInvoiceEntry graph to start unit testing the logic.
I assume that because unit tests don’t use the database, we cannot test logic which use BQL queries or logic which access the database such as [DAC].PK.Find(). Is this the case or am I wrong? Is there a way to either:
1. Create unit tests for logic which query the database.
2. Create code which is unit testable (Maybe best practices would be to always check the cache? So code would be unit-testable as long as we know how to fill the cache.)
Thanks for the help, it is greatly appreciated.