@isTest
private class TydelikeAccControllerTest {
    static testMethod void testMethod1() {
        TydelikeAccount__c acc1 = new TydelikeAccount__c();
            acc1.name = '**';
            acc1.OwnerId = UserInfo.getUserId();
            acc1.TyCity__c = '北京';
            acc1.OfSkrap__c = false;
            acc1.TyAddress__c = '11111';
            acc1.TyPostCode__c = '123456';
            acc1.AssetBS3D__c = '123456';
            acc1.AssetBS2D__c = '123456';
            acc1.OCNServiceStaff__c = UserInfo.getUserId();
            acc1.AssetBS1D__c = '123456';
            acc1.ManagementCode_Ext__c = '123456';
            acc1.Sub_UseD__c = 'LED';
            acc1.AssetBS4D__c = '123456';
            acc1.EnglishNameD__c = '123456';
            acc1.DepartmentNameD__c = '123456';
            acc1.FacilityNameD__c = '123456';
            acc1.IndustryCD__c = 'Education';
            acc1.MarketVerticalsD__c = 'Education';
            acc1.CancelReasonD__c = '123456';
            acc1.ExportRegulatedCustomer__c = true;
            acc1.Province__c = '北京';
            acc1.Whether_OEM__c = true;
            acc1.GlobalAccountName__c = '123456';
            acc1.NationalEnterpriseUser__c = true;
            acc1.DivisionName_D__c = '123456';
            acc1.UseD__c = '(Education)Education';
            acc1.UserType__c = 'OEM客户';
            acc1.WebsiteD__c = 'http://1';
            acc1.KeyAccount__c = 'Large Account';
            acc1.ProductSegment__c = 'BS';
            acc1.FaxD__c = '123456';
            acc1.Remark__c = '123456';
            acc1.DealerSelectOwner__c = UserInfo.getUserId();
            acc1.PhoneD__c = '15555555555';
        insert acc1;

        TydelikeContact__c tycon1 = new TydelikeContact__c();
        	tycon1.name = '*';
        	tycon1.OfSkrap__c = false;
        	tycon1.TydelikeAccount__c = acc1.Id;
        	tycon1.TyAddress__c = '11111';
        	tycon1.TyFaxD__c = '1111';
        	tycon1.TyPhoneD__c = '15555555555';
        	tycon1.TyPostcode__c = '111111';
            tycon1.EnglishAddress__c = '111111';
            tycon1.ContactEnglishName__c = '111111';
        insert tycon1;
        System.debug(tycon1);

        PageReference page = new PageReference('/apex/TydelikeAcc?tyacId=' + acc1.Id + '&tycoId=' + tycon1.Id);
        System.Test.setCurrentPage(page);
        TydelikeAccController controller = new TydelikeAccController();
        controller.init();
        controller.save();
    }
}