From 09119322195feadfb6515bc3d8746721cde150c2 Mon Sep 17 00:00:00 2001 From: adtungadi <124816044+adtungadi@users.noreply.github.com> Date: Thu, 4 Jan 2024 18:38:10 -0500 Subject: [PATCH] uow : Created unit test for uow set sharing --- .../test/classes/fflib_SObjectUnitOfWorkTest.cls | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sfdx-source/apex-common/test/classes/fflib_SObjectUnitOfWorkTest.cls b/sfdx-source/apex-common/test/classes/fflib_SObjectUnitOfWorkTest.cls index 582e759bc38..ee63f12d728 100644 --- a/sfdx-source/apex-common/test/classes/fflib_SObjectUnitOfWorkTest.cls +++ b/sfdx-source/apex-common/test/classes/fflib_SObjectUnitOfWorkTest.cls @@ -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() {