buli
2023-07-14 36d15f189de2e83ce2576715dac30c3c260388dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@isTest
private class LookupSearchResultTest {
<<<<<<< HEAD
    @testSetup
    static void testInfo() {
        List<RecordType> rectCo = [
            SELECT Id
            FROM RecordType
            WHERE IsActive = TRUE AND SobjectType = 'Account' AND Name = '販売店'
        ];
        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;
    }
 
    @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();
    }
}
=======
    @testSetup 
    static void testInfo(){
        List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '販売店'];
        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;
    }
    
    @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();
    }
}
>>>>>>> LEXCommunityLiJun