| | |
| | | Test.stopTest(); |
| | | |
| | | } |
| | | static testMethod void testMethod07() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | ControllerUtil.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | acc.Assume_Change__c = true; |
| | | insert acc; |
| | | |
| | | List<Account> dept = [select Id, Name from Account where ParentId = :acc.Id and Department_Class_Label__c IN ('消化科', '呼吸科') order by Department_Class_Label__c]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | | depart1.Name = '*'; |
| | | depart1.Department_Name__c = 'Gastoro Intestin Test'; |
| | | depart1.ParentId = dept[0].Id; |
| | | depart1.Department_Class__c = dept[0].Id; |
| | | depart1.Hospital__c = acc.Id; |
| | | |
| | | Account depart2 = new Account(); |
| | | depart2.RecordTypeId = rectDpt[1].Id; |
| | | depart2.Name = '*'; |
| | | depart2.Department_Name__c = '診療科2'; |
| | | depart2.ParentId = dept[1].Id; |
| | | depart2.Department_Class__c = dept[1].Id; |
| | | depart2.Hospital__c = acc.Id; |
| | | insert new Account[] {depart1, depart2}; |
| | | |
| | | RecordType oppVND = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity']; |
| | | |
| | | //招标项目 |
| | | Tender_information__c te1 = new Tender_information__c(); |
| | | te1.Name = 'TestZhaoBiao1'; |
| | | te1.IsReactionOpp__c = false; |
| | | te1.Hospital__c = acc.Id; |
| | | insert te1; |
| | | |
| | | Tender_information__c te2 = new Tender_information__c(); |
| | | te1.IsReactionOpp__c = false; |
| | | te2.Name = 'TestZhaoBiao2'; |
| | | insert te2; |
| | | //询价 |
| | | // Opportunity opp1 = new Opportunity( |
| | | // Name = 'test opp1', |
| | | // StageName = '敗戦', |
| | | // CurrencyIsoCode = 'USD', |
| | | // CloseDate = Date.today(), |
| | | // AccountId = depart1.Id, |
| | | // RecordTypeId = oppVND.Id, |
| | | // Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | // Hospital__c = acc.Id, |
| | | // Competitor__c = 'A' |
| | | // ); |
| | | // Opportunity opp2 = new Opportunity( |
| | | // Name = 'test opp2', |
| | | // StageName = '敗戦', |
| | | // CurrencyIsoCode = 'USD', |
| | | // CloseDate = Date.today(), |
| | | // AccountId = depart2.Id, |
| | | // RecordTypeId = oppVND.Id, |
| | | // Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | // Hospital__c = acc.Id, |
| | | // Competitor__c = 'B', |
| | | // Bidding_Project_Name_Bid__c = te1.Id |
| | | // ); |
| | | // Opportunity opp3 = new Opportunity( |
| | | // Name = 'test opp3', |
| | | // StageName = '敗戦', |
| | | // CurrencyIsoCode = 'USD', |
| | | // CloseDate = Date.today(), |
| | | // AccountId = depart2.Id, |
| | | // RecordTypeId = oppVND.Id, |
| | | // Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | // Hospital__c = acc.Id, |
| | | // Competitor__c = 'C', |
| | | // Bidding_Project_Name_Bid__c = te2.Id |
| | | // ); |
| | | // insert new Opportunity[] {opp1, opp2,opp3}; |
| | | |
| | | // opp1.Bidding_Project_Name_Bid__c = te1.Id; |
| | | // opp2.Bidding_Project_Name_Bid__c = te2.Id; |
| | | // opp3.Bidding_Project_Name_Bid__c = null; |
| | | |
| | | // update opp1; |
| | | // update opp2; |
| | | // update opp3; |
| | | |
| | | List<String> tempList = new List<String>(); |
| | | tempList.add(te1.Id); |
| | | tempList.add(te2.Id); |
| | | System.Test.StartTest(); |
| | | UpdateTenderInformationBatch batch = new UpdateTenderInformationBatch('',false); |
| | | Id execBTId = Database.executeBatch(batch); |
| | | System.Test.StopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod08() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | ControllerUtil.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | StaticParameter.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger = true; |
| | | StaticParameter.EscapeNFM001AgencyContractTrigger2 = true; |
| | | StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true; |
| | | |
| | | RecordType rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'Hp']; |
| | | List<RecordType> rectDpt = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName IN ('Department_GI', 'Department_BF') order by DeveloperName desc]; |
| | | |
| | | Account acc = new Account(); |
| | | acc.RecordTypeId = rectCo.Id; |
| | | acc.Name = 'HP test1'; |
| | | insert acc; |
| | | |
| | | List<Account> dept = [select Id, Name from Account where ParentId = :acc.Id and Department_Class_Label__c IN ('消化科', '呼吸科') order by Department_Class_Label__c]; |
| | | |
| | | Account depart1 = new Account(); |
| | | depart1.RecordTypeId = rectDpt[0].Id; |
| | | depart1.Name = '*'; |
| | | depart1.Department_Name__c = 'Gastoro Intestin Test'; |
| | | depart1.ParentId = dept[0].Id; |
| | | depart1.Department_Class__c = dept[0].Id; |
| | | depart1.Hospital__c = acc.Id; |
| | | |
| | | Account depart2 = new Account(); |
| | | depart2.RecordTypeId = rectDpt[1].Id; |
| | | depart2.Name = '*'; |
| | | depart2.Department_Name__c = '診療科2'; |
| | | depart2.ParentId = dept[1].Id; |
| | | depart2.Department_Class__c = dept[1].Id; |
| | | depart2.Hospital__c = acc.Id; |
| | | insert new Account[] {depart1, depart2}; |
| | | |
| | | RecordType oppVND = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity']; |
| | | |
| | | //招标项目 |
| | | Tender_information__c te1 = new Tender_information__c(); |
| | | te1.Name = 'TestZhaoBiao1'; |
| | | insert te1; |
| | | |
| | | Tender_information__c te2 = new Tender_information__c(); |
| | | te2.Name = 'TestZhaoBiao2'; |
| | | insert te2; |
| | | //询价 |
| | | Opportunity opp1 = new Opportunity( |
| | | Name = 'test opp1', |
| | | StageName = '敗戦', |
| | | CurrencyIsoCode = 'USD', |
| | | CloseDate = Date.today(), |
| | | AccountId = depart1.Id, |
| | | RecordTypeId = oppVND.Id, |
| | | Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | Hospital__c = acc.Id, |
| | | Competitor__c = 'A' |
| | | ); |
| | | Opportunity opp2 = new Opportunity( |
| | | Name = 'test opp2', |
| | | StageName = '敗戦', |
| | | CurrencyIsoCode = 'USD', |
| | | CloseDate = Date.today(), |
| | | AccountId = depart2.Id, |
| | | RecordTypeId = oppVND.Id, |
| | | Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | Hospital__c = acc.Id, |
| | | Competitor__c = 'B', |
| | | Bidding_Project_Name_Bid__c = te1.Id |
| | | ); |
| | | Opportunity opp3 = new Opportunity( |
| | | Name = 'test opp3', |
| | | StageName = '敗戦', |
| | | CurrencyIsoCode = 'USD', |
| | | CloseDate = Date.today(), |
| | | AccountId = depart2.Id, |
| | | RecordTypeId = oppVND.Id, |
| | | Closing_Bid_Date__c = Date.today().addDays(-5), |
| | | Hospital__c = acc.Id, |
| | | Competitor__c = 'C', |
| | | Bidding_Project_Name_Bid__c = te2.Id |
| | | ); |
| | | insert new Opportunity[] {opp1, opp2,opp3}; |
| | | |
| | | opp1.Bidding_Project_Name_Bid__c = te1.Id; |
| | | opp2.Bidding_Project_Name_Bid__c = te2.Id; |
| | | opp3.Bidding_Project_Name_Bid__c = null; |
| | | |
| | | update opp1; |
| | | update opp2; |
| | | update opp3; |
| | | |
| | | List<String> tempList = new List<String>(); |
| | | tempList.add(te1.Id); |
| | | tempList.add(te2.Id); |
| | | System.Test.StartTest(); |
| | | UpdateTenderInformationBatch batch = new UpdateTenderInformationBatch(opp1.Id,false,tempList); |
| | | Id execBTId = Database.executeBatch(batch); |
| | | System.Test.StopTest(); |
| | | } |
| | | |
| | | static testMethod void testMethod09() { |
| | | Tender_information__c te1 = new Tender_information__c(); |
| | | te1.Name = 'TestZhaoBiao1'; |
| | | insert te1; |
| | | |
| | | Tender_information__c te2 = new Tender_information__c(); |
| | | te2.Name = 'TestZhaoBiao2'; |
| | | insert te2; |
| | | System.Test.StartTest(); |
| | | UpdateTenderInformationBatch batch = new UpdateTenderInformationBatch(te1.Id); |
| | | System.Test.StopTest(); |
| | | } |
| | | |
| | | |
| | | static testMethod void testMethod10() { |
| | | Tender_information__c te1 = new Tender_information__c(); |
| | | te1.Name = 'TestZhaoBiao1'; |
| | | insert te1; |
| | | |
| | | Tender_information__c te2 = new Tender_information__c(); |
| | | te2.Name = 'TestZhaoBiao2'; |
| | | insert te2; |
| | | List<String> tempList = new List<String>(); |
| | | tempList.add(te1.Id); |
| | | tempList.add(te2.Id); |
| | | System.Test.StartTest(); |
| | | UpdateTenderInformationBatch batch = new UpdateTenderInformationBatch(tempList); |
| | | System.Test.StopTest(); |
| | | } |
| | | } |