Closed stohn777 closed 4 years ago
Although the intent was providing a very simple on, off switch for DML operations during unit testing, the changes is not as concise as desired, given the comparable effort for the other means of bypassing DML, and does intrude upon reasonable engineering principles.
Add
@TestVisible
feature to defaultSimpleDML
class that easily enables skipping of DML operations during mock-based unit testing. Workaround was writing inert, mockIDML
class without any DML operations.See
fflib_SObjectUnitOfWorkTest
for example usage. Snippet here.Significant code changes in
fflib_SObjectUnitOfWork.SimpleDML
and new lines 71 through 136 infflib_SObjectUnitOfWorkTest
.fflib_SObjectUnitOfWork
includes whitespace, indentation consistency change.