From 36d15f189de2e83ce2576715dac30c3c260388dd Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期五, 14 七月 2023 14:47:50 +0800 Subject: [PATCH] fixconflict --- force-app/main/default/classes/LexLicenceReminderControllerTest.cls | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 100 insertions(+), 1 deletions(-) diff --git a/force-app/main/default/classes/LexLicenceReminderControllerTest.cls b/force-app/main/default/classes/LexLicenceReminderControllerTest.cls index 780a11b..3c99e88 100644 --- a/force-app/main/default/classes/LexLicenceReminderControllerTest.cls +++ b/force-app/main/default/classes/LexLicenceReminderControllerTest.cls @@ -1,25 +1,38 @@ @IsTest private class LexLicenceReminderControllerTest { @IsTest +<<<<<<< HEAD static void testMethod1() { +======= + static void testMethod1(){ +>>>>>>> LEXCommunityLiJun User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180); insert l; Test.startTest(); +<<<<<<< HEAD System.runAs(currentUser) { +======= + System.runAs(currentUser){ +>>>>>>> LEXCommunityLiJun LexLicenceReminderController.initReminder(); } Test.stopTest(); } @IsTest +<<<<<<< HEAD static void testMethod2() { +======= + static void testMethod2(){ +>>>>>>> LEXCommunityLiJun Account myAccount1 = new Account(); Contact core = new Contact(); User myUser_test = new User(); User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180); insert l; +<<<<<<< HEAD System.runAs(currentUser) { Profile prof = [ SELECT Id @@ -68,19 +81,79 @@ } Test.startTest(); System.runAs(myUser_test) { +======= + System.runAs(currentUser){ + Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)']; + List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�']; + if (rectCo.size() == 0) { + return; + } + List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌']; + if (rectHos.size() == 0) { + return; + } + + myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' ,AgentCode_Ext__c = '9999900'); + insert myAccount1; + core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); + insert core; + myUser_test = new User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); + insert myUser_test; + } + Test.startTest(); + System.runAs(myUser_test){ LexLicenceReminderController.initReminder(); } Test.stopTest(); } @IsTest - static void testMethod3() { + static void testMethod3(){ Account myAccount1 = new Account(); Contact core = new Contact(); User myUser_test = new User(); User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180); insert l; + System.runAs(currentUser){ + Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)']; + List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�']; + if (rectCo.size() == 0) { + return; + } + List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌']; + if (rectHos.size() == 0) { + return; + } + + myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' ,AgentCode_Ext__c = '9999900',Medical_Equipment_Expiration_Date__c = Date.newInstance(2023, 6, 10)); + insert myAccount1; + core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); + insert core; + myUser_test = new User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); + insert myUser_test; + } + Test.startTest(); + System.runAs(myUser_test){ +>>>>>>> LEXCommunityLiJun + LexLicenceReminderController.initReminder(); + } + Test.stopTest(); + } + + @IsTest +<<<<<<< HEAD + static void testMethod3() { +======= + static void testMethod4(){ +>>>>>>> LEXCommunityLiJun + Account myAccount1 = new Account(); + Contact core = new Contact(); + User myUser_test = new User(); + User currentUser = [SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]; + LicenceReminderDate__c l = new LicenceReminderDate__c(Name = '180Days', ReminderDays__c = 180); + insert l; +<<<<<<< HEAD System.runAs(currentUser) { Profile prof = [ SELECT Id @@ -130,10 +203,33 @@ } Test.startTest(); System.runAs(myUser_test) { +======= + System.runAs(currentUser){ + Profile prof = [select Id from Profile where Name ='901_缁忛攢鍟嗙ぞ鍖烘櫘閫氭潈闄恄2閲嶉獙璇�(ET)']; + List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '璨╁2搴�']; + if (rectCo.size() == 0) { + return; + } + List<RecordType> rectHos = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌']; + if (rectHos.size() == 0) { + return; + } + + myAccount1 = new Account(name='testaccount001',RecordTypeId = rectCo[0].Id,Product_Limit_Date__c = 'Test01|2|4,Test02|3|5' ,AgentCode_Ext__c = '9999900',Medical_Equipment_Expiration_Date__c = Date.newInstance(2025, 6, 10)); + insert myAccount1; + core = new Contact(email='jplumber@salesforce.com', firstname='Joe',lastname='Plumber',accountid=myAccount1.id); + insert core; + myUser_test = new User(ContactId = core.id,Alias = 'newUser',Email='newuser@testorg.com',EmailEncodingKey='UTF-8', LastName='testUser', LanguageLocaleKey='zh_CN',LocaleSidKey='zh_CN', ProfileId = prof.Id,TimeZoneSidKey='Asia/Shanghai', UserName='testUser@testorg.com'); + insert myUser_test; + } + Test.startTest(); + System.runAs(myUser_test){ +>>>>>>> LEXCommunityLiJun LexLicenceReminderController.initReminder(); } Test.stopTest(); } +<<<<<<< HEAD @IsTest static void testMethod4() { @@ -197,3 +293,6 @@ Test.stopTest(); } } +======= +} +>>>>>>> LEXCommunityLiJun -- Gitblit v1.9.1