@isTest
private class AccountDelayApplyHandlerTest {
    @isTest 
	static void TestMethod1() {

        //新建省
        Address_Level__c al = new Address_Level__c();
        al.Name = '東京';
        al.Level1_Code__c = 'CN-99';
        al.Level1_Sys_No__c = '999999';
        insert al;

        Address_Level__c al1 = new Address_Level__c();
        al1.Name = '北京';
        al1.Level1_Code__c = 'CN-99';
        al1.Level1_Sys_No__c = '999999';
        insert al1;

        //新建客户
        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.Is_Active__c = '有効';
        insert acc;

        //新建 客户变更申请
        Account_Delay_Apply__c ada = new Account_Delay_Apply__c();
        ada.Hospital__c = acc.Id;
        ada.ChangeReason__c = '地址错误';
        ada.State_Master__c = al.Id;
        insert ada;

        ada.ChangeReason__c = '其他信息修改';
        ada.State_Master__c = al1.Id;
        update ada;
    }

    @isTest 
	static void TestMethod2() {

        //新建省
        Address_Level__c al = new Address_Level__c();
        al.Name = '東京';
        al.Level1_Code__c = 'CN-99';
        al.Level1_Sys_No__c = '999999';
        insert al;

        Address_Level__c al1 = new Address_Level__c();
        al1.Name = '北京';
        al1.Level1_Code__c = 'CN-99';
        al1.Level1_Sys_No__c = '999999';
        insert al1;

        //新建客户
        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.Is_Active__c = '有効';
        insert acc;

        //新建 客户变更申请
        Account_Delay_Apply__c ada = new Account_Delay_Apply__c();
        ada.Hospital__c = acc.Id;
        ada.ChangeReason__c = '地址错误';
        ada.State_Master__c = al.Id;
        ada.Is_Active__c = '草案中';
        insert ada;

        ada.ChangeReason__c = '其他信息修改';
        ada.State_Master__c = al1.Id;
        ada.Is_Active__c = '申请中';
        update ada;

        ada.Is_Active__c = '审批通过';
        update ada;
    }

}