Li Jun
2022-03-31 3ba0123db48f8bab81ddf0913e1b95280ef545e8
force-app/main/default/classes/LightningUtilTest.cls
@@ -101,10 +101,12 @@
        insert user;
        List < user > users = [select Id, Name, LastName, FirstName from User where LastName = 'テスト'];
        System.assertEquals('ユーザー', users[0].FirstName);
        System.runAs(user) {
        agency_hospital_link.Name = 'test1代理店医院';
        agency_hospital_link.Hospital__c = account1.Id;
        agency_hospital_link.Agency__c = account2.Id;
        agency_hospital_link.OwnerId = user.Id;
        // agency_hospital_link.OwnerId = user.Id;
        agency_hospital_link.Agency_Campaign_Obj__c = true;
        insert agency_hospital_link;
        List < Agency_Hospital_Link__c > agencylist = [select Id, Name from Agency_Hospital_Link__c where Id = : agency_hospital_link.Id];
@@ -117,7 +119,7 @@
        agency_opportunity.Agency__c = account2.Id;
        agency_opportunity.Agency_Hospital__c = agency_hospital_link.Id;
        agency_opportunity.StageName__c = '还没申请预算';
        agency_opportunity.OwnerId = user.Id;
        // agency_opportunity.OwnerId = user.Id;
        agency_opportunity.NewOpportunity_Agency_Apply_Status__c = '批准';
        agency_opportunity.Department_Cateogy__c = 'ET';
        agency_opportunity.Sales_Manager__c = user.Id;
@@ -130,7 +132,7 @@
        agency_opportunity2.Name = '引合2';
        agency_opportunity2.Hospital_Target__c = account1.Id;
        agency_opportunity2.Agency__c = account2.Id;
        agency_opportunity2.OwnerId = user.Id;
        // agency_opportunity2.OwnerId = user.Id;
        agency_opportunity2.NewOpportunity_Agency_Apply_Status__c = '草案中';
        agency_opportunity2.Department_Cateogy__c = 'GS';
        agency_opportunity2.Sales_Manager__c = UserInfo.getUserId();
@@ -139,11 +141,13 @@
        List < Agency_Opportunity__c > opportunitylist2 = [select Id, Name from Agency_Opportunity__c];
        System.assertEquals(2, opportunitylist2.size());
        olympus_calendar.Date__c = Date.valueOf('2017-04-10');
        olympus_calendar.OwnerId = user.Id;
        // olympus_calendar.OwnerId = user.Id;
        insert olympus_calendar;
        List < OlympusCalendar__c > olympusCalendarlist = [select Id, Name, Date__c from OlympusCalendar__c];
        System.assertEquals(Date.valueOf('2017-04-10'), olympusCalendarlist[0].Date__c);
        System.runAs(user) {
            List < Agency_Opportunity__c > opportunity_data = WeeklyReportCmp.selectOpportunityByIdAndHospitalLinkId(agency_opportunity.Id, agency_hospital_link.Id);
            List < Agency_Opportunity__c > agencyopportunity = [select Id, Name, Agency__c, Agency_ID__c, Owner_Agency_ID__c,
                Agency_Hospital_All__c, Agency_Hospital__c, Agency_Hospital_Target__c