liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
@isTest
private class infrastructureProjectRelatedOppTest {
    static testMethod void test01() {
        RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp'];
        Account acc = new Account();
        acc.RecordTypeId = rectCo.Id;
        acc.Name = 'HP test1';
        acc.Assume_Change__c = true;
        insert acc;
        Infrastructure_Project__c jijian = new Infrastructure_Project__c();
        jijian.Name = 'ceshi jijian ';
        jijian.OCSM_Hospital__c = acc.Id;
        insert jijian;
        Opportunity opp = new Opportunity();
        opp.Name = 'test询价';
        opp.StageName = '引合';
        opp.SAP_Send_OK__c = false;
        opp.CloseDate = Date.newInstance(2023, 9, 15);
        opp.Hospital__c = acc.Id;
        insert opp;
        infrastructureProjectRelatedOpController.selectInfrastructureProjectById(String.valueOf(jijian.Id));
        infrastructureProjectRelatedOpController.selectoppByAccountId(String.valueOf(opp.Hospital__c));
        infrastructureProjectRelatedOpController.selectoppByOpportunityNoc(String.valueOf(opp.Hospital__c),'te');
        opp.Infrastructure_Project__c = jijian.Id;
        List<Opportunity> listName = new List<Opportunity>();
        listName.add(opp);
        String jon = JSON.serialize(listName);
        infrastructureProjectRelatedOpController.saveOppInfrastructureProject(jon);
    }
}