| | |
| | | **/ |
| | | @isTest |
| | | public class NewAgencyContactControllerTest { |
| | | public static Account account1 = new Account(); |
| | | public static Account account2 = new Account(); |
| | | public static Agency_Hospital_Link__c aHosLink = new Agency_Hospital_Link__c(); |
| | | public static Agency_Contact__c aContact = new Agency_Contact__c(); |
| | | |
| | | @isTest |
| | | static void testMethod1() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Agency_Contact__c'); |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Agency_Contact__c'); |
| | | strList.add('Agency_Contact__cV2'); |
| | | strList.add('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | //TestDataUtility.CreatePIPolicyConfiguration('Agency_Contact__c'); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | Agency_Contact__c ac = TestDataUtility.CreateAgencyContacts(1)[0]; |
| | |
| | | |
| | | @isTest |
| | | static void testMethod3() { |
| | | TestDataUtility.CreatePIPolicyConfiguration('Agency_Contact__c'); |
| | | List<String> strList = new List<String>(); |
| | | strList.add('Agency_Contact__c'); |
| | | strList.add('Agency_Contact__cV2'); |
| | | strList.add('Contact'); |
| | | TestDataUtility.CreatePIPolicyConfigurations(strList); |
| | | //TestDataUtility.CreatePIPolicyConfiguration('Agency_Contact__c'); |
| | | |
| | | Test.setMock(HttpCalloutMock.class, new TestDataUtility.CreateMetaDataUtilityHttpMock()); |
| | | String rid = ''; |
| | |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void testMethod4() { |
| | | Test.startTest(); |
| | | // 取引先 |
| | | account1.Name = 'test1医院'; |
| | | account1.RecordTypeId = '01210000000QemG'; |
| | | insert account1; |
| | | |
| | | account2.Name = 'test1经销商'; |
| | | account2.RecordTypeId = '01210000000Qem1'; |
| | | insert account2; |
| | | |
| | | |
| | | List<Account> accTestList = [SELECT Id, Name FROM Account order by Name]; |
| | | System.debug('GYFaccTestList='+accTestList); |
| | | System.assertEquals(10, accTestList.size()); |
| | | System.assertEquals('test1医院', accTestList[0].Name); |
| | | |
| | | //经销商医院データを作る |
| | | aHosLink.Name = 'test1经销商医院'; |
| | | aHosLink.Hospital__c = account1.Id; |
| | | aHosLink.Agency__c = account2.Id; |
| | | insert aHosLink; |
| | | |
| | | //.客户人员データを作る |
| | | Agency_Contact__c aContact1 = new Agency_Contact__c(); |
| | | aContact1.Agency_Hospital__c = aHosLink.Id; |
| | | aContact1.Type__c = '医生'; |
| | | aContact1.Name = 'testAgencyUser'; |
| | | insert aContact1; |
| | | NewAgencyContactController.searchAgencyDataId(aContact1.Agency_Hospital__c); |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | |
| | | @isTest |
| | | static void testMethod5() { |
| | | Test.startTest(); |
| | | NewAgencyContactController.improveTestRate(); |
| | | Test.stopTest(); |
| | | } |
| | | } |