@isTest private class ContactTriggerHandlerTest { static testMethod void myUnitTest() { List rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE']; User user = new User(); user.LastName = 'test02'; user.FirstName = 'test'; user.Alias = 'test02'; user.Email = 'test@test02.com'; user.Username = 'test111@test3222.com'; user.CommunityNickname = 'test1111'; user.IsActive = true; user.EmailEncodingKey = 'ISO-2022-JP'; user.TimeZoneSidKey = 'Asia/Tokyo'; user.LocaleSidKey = 'ja_JP'; user.LanguageLocaleKey = 'ja'; user.ProfileId = System.Label.SystemAdmin; insert user; Account acc = new Account(); acc.Name = '*'; acc.DivisionName__c = 'DivisionName__c'; acc.FacilityName__c = 'FacilityName__c'; acc.PostCode__c='000000'; acc.stautesD__c= 'Pass'; insert acc; Contact con = new Contact(); con.LastName = 'test'; con.AccountId = acc.Id; con.MobilePhone = 'MobilePhoneD__c'; con.OtherPhone = 'OtherPhoneD__c'; con.Fax = 'FaxD__c'; con.Email = 'EmailD__c@test.com'; con.Phone = 'PhoneD__c'; con.Title = 'TitleD__c'; con.Address1__c = 'Address1D__c'; con.Address2__c = 'Address2D__c'; con.Address3__c = 'Address3D__c'; con.Postcode__c = '100111'; con.ContactStatus__c = 'ContactStatusD__c'; con.CancelReason__c = 'CancelReasonD__c'; con.StatusD__c = 'Pass'; insert con; con.MobilePhone = 'MobilePhone'; con.OtherPhone = 'OtherPhone'; con.Fax = 'Fax'; con.Email = 'Email@test.com'; con.Phone = 'Phone'; con.Title = 'Title'; con.Address1__c = 'Address1__c'; con.Address2__c = 'Address2__c'; con.Address3__c = 'Address3__c'; con.Postcode__c = '100222'; con.ContactStatus__c = 'ContactStatus__c'; con.CancelReason__c = 'CancelReason__c'; update con; con.MobilePhoneD__c = 'MobilePhoneD__c'; con.OtherPhoneD__c = 'OtherPhoneD__c'; con.FaxD__c = 'FaxD__c'; con.EmailD__c = 'EmailD__c@test.com'; con.PhoneD__c = 'PhoneD__c'; con.TitleD__c = 'TitleD__c'; con.Address1D__c = 'Address1D__c'; con.Address2D__c = 'Address2D__c'; con.Address3D__c = 'Address3D__c'; con.PostcodeD__c = '100111'; con.ContactStatusD__c = 'ContactStatusD__c'; con.CancelReasonD__c = 'CancelReasonD__c'; update con; con.StatusD__c = 'Completed'; update con; con.StatusD__c = 'Submit'; update con; con.StatusD__c = 'Pass'; update con; con.StatusD__c = 'Reject'; update con; } }