| | |
| | | u2.Province__c = '東京'; |
| | | u2.IsActive = true; |
| | | insert u2; |
| | | |
| | | /** |
| | | User u3 = new User(Test_staff__c = true); |
| | | u3.LastName = '1222'; |
| | | u3.FirstName = 'い'; |
| | |
| | | u5.Province__c = '東京'; |
| | | u5.IsActive = true; |
| | | insert u5; |
| | | |
| | | **/ |
| | | OCM_Management_Province__c mp1 = new OCM_Management_Province__c(); |
| | | mp1.Name = '北京'; |
| | | mp1.GI_assistant__c = u1.Id; |
| | | mp1.SP_assistant__c = u2.Id; |
| | | mp1.Window2__c = u3.Id; |
| | | mp1.Admin_assistant3__c = u4.Id; |
| | | //mp1.Window2__c = u3.Id; |
| | | //mp1.Admin_assistant3__c = u4.Id; |
| | | insert mp1; |
| | | |
| | | //创建一个医院 |
| | |
| | | hospital.GI_Main__c = u1.Id; |
| | | hospital.BF_owner__c = u2.Id; |
| | | hospital.ET_owner__c = u2.Id; |
| | | hospital.SP_Main__c = u3.Id; |
| | | hospital.URO_owner_ID__c = u4.Id; |
| | | hospital.GYN_owner__c = u1.Id; |
| | | hospital.ENT_owner_ID__c = u1.Id; |
| | | //hospital.SP_Main__c = u3.Id; |
| | | //hospital.URO_owner_ID__c = u4.Id; |
| | | //hospital.GYN_owner__c = u1.Id; |
| | | //hospital.ENT_owner_ID__c = u1.Id; |
| | | insert hospital; |
| | | |
| | | // テストデータ |
| | |
| | | info1.OpportunityNum__c = 0; |
| | | info1.OwnerId = u1.Id; |
| | | info1.InfoOwner__c = u2.Id; |
| | | info1.relativeTime__c =System.now(); |
| | | insert info1; |
| | | |
| | | Test.startTest(); |
| | |
| | | |
| | | // info1.InfoType__c= '3:结果'; |
| | | // update info1; |
| | | |
| | | StaticParameter.EscapeTOLinkTrigger=false; |
| | | delete link1; |
| | | } |
| | | |
| | | System.runAs(u2){ |
| | | //System.runAs(u2){ |
| | | |
| | | // 插入招标项目2 |
| | | Tender_information__c info2 = new Tender_information__c(); |
| | | info2.Name = 'TEST001'; |
| | | info2.AreaProvince__c = '北京'; |
| | | // info2.Hospital__c = hospital.Id; |
| | | info2.InfoType__c= '1:公告'; |
| | | info2.OpportunityNum__c = 0; |
| | | info2.OwnerId = u1.Id; |
| | | info2.InfoOwner__c = u2.Id; |
| | | insert info2; |
| | | info2.IsBid__c = '否'; |
| | | info2.NotBidApprovalStatus__c = '申请中'; |
| | | update info2; |
| | | // // 插入招标项目2 |
| | | // Tender_information__c info2 = new Tender_information__c(); |
| | | // info2.Name = 'TEST001'; |
| | | // info2.AreaProvince__c = '北京'; |
| | | // // info2.Hospital__c = hospital.Id; |
| | | // info2.InfoType__c= '1:公告'; |
| | | // info2.OpportunityNum__c = 0; |
| | | // info2.OwnerId = u1.Id; |
| | | // info2.InfoOwner__c = u2.Id; |
| | | // info2.relativeTime__c =System.now(); |
| | | // insert info2; |
| | | // info2.IsBid__c = '否'; |
| | | // info2.NotBidApprovalStatus__c = '申请中'; |
| | | // update info2; |
| | | |
| | | // 插入关联关系 |
| | | Tender_Opportunity_Link__c link2 = new Tender_Opportunity_Link__c(); |
| | | link2.Tender_information__c = info2.Id; |
| | | link2.Opportunity__c = opp1.Id; |
| | | insert link2; |
| | | // // 插入关联关系 |
| | | // Tender_Opportunity_Link__c link2 = new Tender_Opportunity_Link__c(); |
| | | // link2.Tender_information__c = info2.Id; |
| | | // link2.Opportunity__c = opp1.Id; |
| | | // insert link2; |
| | | |
| | | // 插入关联关系 |
| | | Tender_Opportunity_Link__c link3 = new Tender_Opportunity_Link__c(); |
| | | link3.Tender_information__c = info1.Id; |
| | | link3.Opportunity__c = opp1.Id; |
| | | insert link3; |
| | | // //// 插入关联关系 |
| | | // //Tender_Opportunity_Link__c link3 = new Tender_Opportunity_Link__c(); |
| | | // //link3.Tender_information__c = info1.Id; |
| | | // //link3.Opportunity__c = opp1.Id; |
| | | // //insert link3; |
| | | |
| | | delete link2; |
| | | } |
| | | // delete link2; |
| | | //} |
| | | |
| | | Test.stopTest(); |
| | | } |
| | | static testMethod void testMethod1() { |
| | | TenderOpportunityLinkHandler.testI(); |
| | | } |
| | | |
| | | } |