| | |
| | | List<Account> acclist=[select RecordTypeId,Name |
| | | from Account |
| | | ]; |
| | | |
| | | //System.assertEquals('test1医院',acclist[0].Name); |
| | | //System.assertEquals(9,acclist.size()); |
| | | |
| | | |
| | | account2.Name = 'test1经销商'; |
| | |
| | | insert new List<contact> {contact1,contact2,contact3}; |
| | | |
| | | Test.startTest(); |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | // ユーザー |
| | | //Profile p = [select Id from Profile where Name = '901_经销商周报']; |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | |
| | | opp.StageName = '目標'; |
| | | //opp.AgencyOpp_FromOCM__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | insert opp; |
| | | opp.SAP_Send_OK__c = true; |
| | | |
| | |
| | | opp2.Name = 'test询价2'; |
| | | opp2.StageName = '目標2'; |
| | | opp2.SAP_Send_OK__c = false; |
| | | opp2.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp2.CloseDate = Date.newInstance(2023, 7, 15); |
| | | opp2.SAP_Send_OK__c = true; |
| | | |
| | | // Test.startTest(); |
| | |
| | | FROM Agency_Opportunity__Share |
| | | WHERE ParentId=:agency_opportunity.Id and RowCause <>:rowCause]; |
| | | System.assertEquals(user.Id, agencyopportunityShare[0].UserOrGroupId); |
| | | } |
| | | } |
| | | |
| | | // 经销商所有者テスト |
| | |
| | | insert new List<contact> {contact1,contact2,contact3}; |
| | | //insert new List<contact> {contact1,contact2}; |
| | | |
| | | |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | // ユーザー |
| | | //Profile p = [select Id from Profile where Name = '901_经销商周报']; |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | |
| | | opp.StageName = '目標'; |
| | | //opp.AgencyOpp_FromOCM__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | opp.OwnerId = user.Id; |
| | | insert opp; |
| | | |
| | |
| | | System.assertEquals(userList[0].SalesManager__c, aoList[0].Sales_Manager_F__c); |
| | | //System.assertEquals(aoList[0].Sales_Manager_F__c, aoList[0].Sales_Manager__c); |
| | | } |
| | | } |
| | | |
| | | // 普通所有者テスト |
| | | @isTest |
| | |
| | | contact3.FirstName = '責任者'; |
| | | contact3.LastName = 'test2经销商'; |
| | | insert new List<contact> {contact1,contact2,contact3}; |
| | | |
| | | User thisUser= [select Id from User where Id=:UserInfo.getUserId()]; |
| | | System.runAs (thisUser){ |
| | | // ユーザー |
| | | //Profile p = [select Id from Profile where Name = '901_经销商周报']; |
| | | Profile p = [select Id from Profile where Name = '901_经销商活动系统']; |
| | |
| | | opp.StageName = '目標'; |
| | | //opp.AgencyOpp_FromOCM__c = true; |
| | | opp.SAP_Send_OK__c = false; |
| | | opp.CloseDate = Date.newInstance(2222, 7, 15); |
| | | opp.CloseDate = Date.newInstance(2023, 7, 15); |
| | | opp.OwnerId = user3.Id; |
| | | insert opp; |
| | | |
| | |
| | | System.assertEquals(userList[0].SalesManager__c, aoList[0].Sales_Manager_F__c); |
| | | //System.assertEquals(aoList[0].Sales_Manager_F__c, aoList[0].Sales_Manager__c); |
| | | } |
| | | } |
| | | |
| | | public static void makeNormalData(boolean withAgencyDetail) { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |