Skip to content

Commit

Permalink
uow : Created unit test for uow set sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
adtungadi committed Jan 4, 2024
1 parent 748ad31 commit 0911932
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ private with sharing class fflib_SObjectUnitOfWorkTest
Opportunity.SObjectType,
OpportunityLineItem.SObjectType };

@IsTest
private static void testUnitOfWorkSetSharing() {
fflib_SObjectUnitOfWork unitOfWork = new fflib_SObjectUnitOfWork(MY_SOBJECTS);
Assert.isInstanceOfType(unitOfWork.m_dml, fflib_SObjectUnitOfWork.SimpleDML.class);

unitOfWork.setSharingMode(fflib_SObjectUnitOfWork.SharingMode.WITH);
Assert.isInstanceOfType(unitOfWork.m_dml, fflib_SObjectUnitOfWork.WithSharingDML.class);

unitOfWork.setSharingMode(fflib_SObjectUnitOfWork.SharingMode.WITHOUT);
Assert.isInstanceOfType(unitOfWork.m_dml, fflib_SObjectUnitOfWork.WithoutSharingDML.class);
}

@IsTest
private static void testUnitOfWorkEmail()
{
Expand Down

0 comments on commit 0911932

Please sign in to comment.