@isTest
private class UpdateOppLastModifiedBatchTest {

    @IsTest
	static void TestMethod01() {

        StaticParameter.EscapeOppandStaTrigger = true;

        Tender_information__c TenInfo = new Tender_information__c();
        TenInfo.Name = 'Test20240117';
        insert TenInfo;

        Tender_information__History tenH = new Tender_information__History();
        tenH.Field = 'Bid_Winning_Date__c';
        tenH.ParentId = TenInfo.Id;
        insert tenH;

        Opportunity opp = new Opportunity();
        opp.Name = 'test询价';
        opp.StageName = '目標';
        opp.SAP_Send_OK__c = false;
        opp.CloseDate = Date.newInstance(2024, 7, 15);
        opp.Bidding_Project_Name_Bid__c = TenInfo.Id;
        insert opp;

        List<String> str = new List<String>();
		str.add(TenInfo.Id);

		Test.StartTest();
		Database.executeBatch( new UpdateOppLastModifiedBatch(),100);
		Database.executeBatch( new UpdateOppLastModifiedBatch(str),100);
		Test.stopTest();

        StaticParameter.EscapeOppandStaTrigger = false;
	}

}