From e6068da47c1bef5517c9e5fdc8c726766867ad4e Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期五, 14 七月 2023 15:10:02 +0800 Subject: [PATCH] Merge branch 'master' into LEXUpgrade2023-Deloitte --- force-app/main/default/classes/LookupSearchResultTest.cls | 88 +++++++++++++++---------------------------- 1 files changed, 31 insertions(+), 57 deletions(-) diff --git a/force-app/main/default/classes/LookupSearchResultTest.cls b/force-app/main/default/classes/LookupSearchResultTest.cls index 3808289..8db8dda 100644 --- a/force-app/main/default/classes/LookupSearchResultTest.cls +++ b/force-app/main/default/classes/LookupSearchResultTest.cls @@ -1,63 +1,37 @@ @isTest private class LookupSearchResultTest { - @testSetup - static void testInfo() { - List<RecordType> rectCo = [ - SELECT Id - FROM RecordType - WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�' - ]; - if (rectCo.size() == 0) { - return; + @testSetup + static void testInfo() { + List<RecordType> rectCo = [SELECT Id FROM RecordType WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '璨╁2搴�']; + if (rectCo.size() == 0) { + return; + } + Account myAccount2 = new Account(name = 'Account001', Dealer_discount__c = 20, RecordTypeId = rectCo[0].Id, AgentCode_Ext__c = '2'); + insert myAccount2; } - Account myAccount2 = new Account( - name = 'Account001', - Dealer_discount__c = 20, - RecordTypeId = rectCo[0].Id, - AgentCode_Ext__c = '2' - ); - insert myAccount2; - } - @isTest - static void testLookupSearchResult() { - String id = ''; - String title = ''; - List<Account> account = [ - SELECT Id, Name - FROM Account - WHERE Name = 'Account001' - LIMIT 1 - ]; - for (Account acc : account) { - id = acc.Id; + @isTest + static void testLookupSearchResult() { + String id = ''; + String title = ''; + List<Account> account = [SELECT Id, Name FROM Account WHERE Name = 'Account001' LIMIT 1]; + for (Account acc : account) { + id = acc.Id; + } + object compareTo = account; + LookupSearchResult resultA = new LookupSearchResult(id, 'Account', 'standard:account', 'Account', 'Account'); + LookupSearchResult resultB = new LookupSearchResult('', '', '', title, ''); + LookupSearchResult resultC = new LookupSearchResult(id, 'Account', 'standard:account', title, 'Account'); + System.Test.startTest(); + resultA.getId(); + resultA.getSObjectType(); + resultA.getIcon(); + resultA.getTitle(); + resultA.getSubtitle(); + resultB.compareTo(resultB); + System.assertEquals(1, account.size(), 'expecting to find 1 Account'); + List<LookupSearchResult> con = new List<LookupSearchResult>(); + con.sort(); + System.Test.stopTest(); } - object compareTo = account; - LookupSearchResult resultA = new LookupSearchResult( - id, - 'Account', - 'standard:account', - 'Account', - 'Account' - ); - LookupSearchResult resultB = new LookupSearchResult('', '', '', title, ''); - LookupSearchResult resultC = new LookupSearchResult( - id, - 'Account', - 'standard:account', - title, - 'Account' - ); - System.Test.startTest(); - resultA.getId(); - resultA.getSObjectType(); - resultA.getIcon(); - resultA.getTitle(); - resultA.getSubtitle(); - resultB.compareTo(resultB); - System.assertEquals(1, account.size(), 'expecting to find 1 Account'); - List<LookupSearchResult> con = new List<LookupSearchResult>(); - con.sort(); - System.Test.stopTest(); - } } -- Gitblit v1.9.1