Skip to content

Commit

Permalink
more updates but still don't have it yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJohnMDaniel committed Nov 30, 2024
1 parent 2fa4da3 commit 4b19716
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions sfdx-source/apex-common/test/classes/fflib_ApplicationTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
@IsTest
private class fflib_ApplicationTest
public class fflib_ApplicationTest
implements IAccountsSelector
{
@IsTest
private static void callingDomainFactoryShouldGiveRegisteredImplsAndMocks()
Expand Down Expand Up @@ -78,8 +79,7 @@ private class fflib_ApplicationTest

// Given
fflib_ApexMocks mocks = new fflib_ApexMocks();
mocks.startStubbing();
// fflib_ISObjectDomain domainMock = new fflib_SObjectMocks.SObjectDomain(mocks);
mocks.startStubbing();
fflib_ApplicationTest.IAccounts accountsDomainMock = (fflib_ApplicationTest.IAccounts)mocks.mock(fflib_ApplicationTest.IAccounts.class);
mocks.when(accountsDomainMock.sObjectType()).thenReturn(Account.SObjectType);
mocks.stopStubbing();
Expand Down Expand Up @@ -347,8 +347,10 @@ private class fflib_ApplicationTest
{
// Given
fflib_ApexMocks mocks = new fflib_ApexMocks();
IAccountsSelector mockAccountsSelector = (IAccountsSelector)mocks.mock(IAccountsSelector.class);

// IAccountsSelector mockAccountsSelector = (IAccountsSelector)mocks.mock(IAccountsSelector.class); ///////**** */
// extends fflib_ISObjectSelector
// fflib_ISObjectSelector mockAccountsSelector = (fflib_ISObjectSelector)mocks.mock(fflib_ISObjectSelector.class); ///////**** */
IAccountsSelector mockAccountsSelector = (IAccountsSelector)mocks.mock(fflib_ApplicationTest.class); ///////**** */
Id testAccountId = fflib_IDGenerator.generate(Account.SObjectType);
List<Account> accounts =
new List<Account>
Expand Down Expand Up @@ -698,4 +700,29 @@ private class fflib_ApplicationTest
public class OpportunitiesServiceImpl implements IOpportunitiesService { }

public class AccountsServiceImpl implements IAccountsService { }

public List<Schema.SObjectField> getSObjectFieldList()
{
return new List<Schema.SObjectField> {
Account.Name,
Account.Id,
Account.AccountNumber,
Account.AnnualRevenue
};
}

public Schema.SObjectType getSObjectType()
{
return Account.sObjectType;
}

public Schema.SObjectType sObjectType()
{
return Account.sObjectType;
}

public List<SObject> selectSObjectsById(Set<Id> idSet)
{
return new List<SObject>();
}
}

0 comments on commit 4b19716

Please sign in to comment.