@isTest public with sharing class LexAgenceCopyPIControllerTest { static testMethod void testMethod1() { LexAgenceCopyPIController.init('123'); LexAgenceCopyPIController.init2('123'); LexAgenceCopyPIController.typeid(); LexAgenceCopyPIController.init3('123'); } static testMethod void testMethod2(){ Profile prof = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; List rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '病院']; User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = prof.id); insert hpOwner; Account myAccount1 = new Account(name='testaccount001',RecordTypeId = rectHp[0].Id,OwnerId = hpOwner.Id ); insert myAccount1; Contact core = new Contact(email='jplumber@salesforce.com', firstname='Joe', lastname='Plumber', accountid=myAccount1.id); insert core; LexAgenceCopyPIController.init2(core.Id); } }