@isTest
private class NFM501TIDetailHistoryDataBatchTest {

    static testMethod void testMethod1() {
        Tender_information__c tender = new Tender_information__c();
        tender.Name = 'test-tender';
        tender.OwnerId = '00510000000fSYI';
        tender.ProjectId__c = 'dfdfaaefc3414f74bd4402a9aedaed4c';
        insert tender;

        Tender_information_details__c detail = new Tender_information_details__c();
        detail.Name = 'test-detail';
        detail.Tender_information__c = tender.Id;
        detail.ProjectId__c = tender.ProjectId__c;
        insert detail;

        BatchIF_Log__c log = new BatchIF_Log__c();
        log.Type__c = 'NFM501';
        log.OwnerId = '00510000000fSYI';
        log.RowDataFlg__c = true;
        log.Log__c = '{"data":{"list1":[{"DataId":"969656333198426115","agentRelationWayEncrypted":[],"agentRelationNameEncrypted":[],"zhongRelationWayEncrypted":[],"zhongRelationNameEncrypted":[],"zhaoRelationWayEncrypted":["2b1d23d5321beba62dc9bad4cf7e07df"],"zhaoRelationNameEncrypted":["480e98b8aa0c30ca4fc22254d6ad3ad7"],"allKeywords":"","moreZhongBiaoUnit":[],"zhongRelationWay":[],"zhongRelationName":[],"zhongBiaoUnit":[],"zhaoRelationWay":["***********"],"zhaoRelationName":["***"],"zhaoBiaoUnit":["南方医科大学顺德医院附属杏坛医院采购部"],"xmNumber":"","winnerAmount":[],"tenderEndTime":"","tenderBeginTime":"","target":{"targetDetails":[{"tarKeyword":"胃肠镜,肠镜","brand":"","model":"","name":"富士胃肠镜机故障维修院内市场调研会议","price":"","totalPrice":"","number1":"3"}]},"projectId":"dfdfaaefc3414f74bd4402a9aedaed4c","openBidingTime":"","keywords":"胃肠镜,肠镜","isElectronic":"0","infoTypeSegment":"11","infoType":"3","infoTitle":"院内调研结果公告","infoQianlimaUrl":"http://www.qianlima.com/zb/detail/20220429_269810737.html","infoPublishTime":"2022-04-29 08:58:12","infoId":"269810737","infoFile":[],"budget":[],"bidingEndTime":"","bidingAcquireTime":"","biddingType":"0","areaProvince":"广东省","areaCountry":"顺德区","areaCity":"佛山市","agentUnit":[],"agentRelationWay":[],"agentRelationName":[]}],"cursorMark":"626b6499203862a5002df284"},"code":"0","msg":"正确返回数据"}';
        insert log;

        System.Test.StartTest();
        Id execBTId = Database.executeBatch(new NFM501TIDetailHistoryDataBatch('2022-06-22', '2022-06-29'));
        System.Test.StopTest();
    }

    static testMethod void testMethod2() {
        Tender_information__c tender = new Tender_information__c();
        tender.Name = 'test-tender';
        tender.OwnerId = '00510000000fSYI';
        tender.ProjectId__c = 'dfdfaaefc3414f74bd4402a9aedaed4c';
        insert tender;

        Tender_information_details__c detail = new Tender_information_details__c();
        detail.Name = 'test-detail';
        detail.Tender_information__c = tender.Id;
        detail.ProjectId__c = tender.ProjectId__c;
        insert detail;

        BatchIF_Log__c log = new BatchIF_Log__c();
        log.Type__c = 'NFM501';
        log.OwnerId = '00510000000fSYI';
        log.RowDataFlg__c = true;
        log.Log__c = '{"data":{"list1":[{"DataId":"969656333198426115","agentRelationWayEncrypted":[],"agentRelationNameEncrypted":[],"zhongRelationWayEncrypted":[],"zhongRelationNameEncrypted":[],"zhaoRelationWayEncrypted":["2b1d23d5321beba62dc9bad4cf7e07df"],"zhaoRelationNameEncrypted":["480e98b8aa0c30ca4fc22254d6ad3ad7"],"allKeywords":"","moreZhongBiaoUnit":[],"zhongRelationWay":[],"zhongRelationName":[],"zhongBiaoUnit":[],"zhaoRelationWay":["***********"],"zhaoRelationName":["***"],"zhaoBiaoUnit":["南方医科大学顺德医院附属杏坛医院采购部"],"xmNumber":"","winnerAmount":[],"tenderEndTime":"","tenderBeginTime":"","target":{"targetDetails":[{"tarKeyword":"胃肠镜,肠镜","brand":"","model":"","name":"富士胃肠镜机故障维修院内市场调研会议","price":"","totalPrice":"","number1":"3"}]},"projectId":"dfdfaaefc3414f74bd4402a9aedaed4c","openBidingTime":"","keywords":"胃肠镜,肠镜","isElectronic":"0","infoTypeSegment":"11","infoType":"3","infoTitle":"院内调研结果公告","infoQianlimaUrl":"http://www.qianlima.com/zb/detail/20220429_269810737.html","infoPublishTime":"2022-04-29 08:58:12","infoId":"269810737","infoFile":[],"budget":[],"bidingEndTime":"","bidingAcquireTime":"","biddingType":"0","areaProvince":"广东省","areaCountry":"顺德区","areaCity":"佛山市","agentUnit":[],"agentRelationWay":[],"agentRelationName":[]}],"cursorMark":"626b6499203862a5002df284"},"code":"0","msg":"正确返回数据"}';
        insert log;

        System.Test.StartTest();
        Id execBTId = Database.executeBatch(new NFM501TIDetailHistoryDataBatch());
        System.Test.StopTest();
    }

    static testMethod void testMethod3() {
        Tender_information__c tender = new Tender_information__c();
        tender.Name = 'test-tender';
        tender.OwnerId = '00510000000fSYI';
        tender.ProjectId__c = 'dfdfaaefc3414f74bd4402a9aedaed4c';
        insert tender;

        Tender_information_details__c detail = new Tender_information_details__c();
        detail.Name = 'test-detail';
        detail.Tender_information__c = tender.Id;
        detail.ProjectId__c = tender.ProjectId__c;
        insert detail;

        BatchIF_Log__c log = new BatchIF_Log__c();
        log.Type__c = 'NFM501';
        log.OwnerId = '00510000000fSYI';
        log.RowDataFlg__c = true;
        log.Log__c = '{"data":{"list1":[{"DataId":"969656333198426115","agentRelationWayEncrypted":[],"agentRelationNameEncrypted":[],"zhongRelationWayEncrypted":[],"zhongRelationNameEncrypted":[],"zhaoRelationWayEncrypted":["2b1d23d5321beba62dc9bad4cf7e07df"],"zhaoRelationNameEncrypted":["480e98b8aa0c30ca4fc22254d6ad3ad7"],"allKeywords":"","moreZhongBiaoUnit":[],"zhongRelationWay":[],"zhongRelationName":[],"zhongBiaoUnit":[],"zhaoRelationWay":["***********"],"zhaoRelationName":["***"],"zhaoBiaoUnit":["南方医科大学顺德医院附属杏坛医院采购部"],"xmNumber":"","winnerAmount":[],"tenderEndTime":"","tenderBeginTime":"","target":{"targetDetails":[{"tarKeyword":"胃肠镜,肠镜","brand":"","model":"","name":"富士胃肠镜机故障维修院内市场调研会议","price":"","totalPrice":"","number1":"3"}]},"projectId":"dfdfaaefc3414f74bd4402a9aedaed4c","openBidingTime":"","keywords":"胃肠镜,肠镜","isElectronic":"0","infoTypeSegment":"11","infoType":"3","infoTitle":"院内调研结果公告","infoQianlimaUrl":"http://www.qianlima.com/zb/detail/20220429_269810737.html","infoPublishTime":"2022-04-29 08:58:12","infoId":"269810737","infoFile":[],"budget":[],"bidingEndTime":"","bidingAcquireTime":"","biddingType":"0","areaProvince":"广东省","areaCountry":"顺德区","areaCity":"佛山市","agentUnit":[],"agentRelationWay":[],"agentRelationName":[]}],"cursorMark":"626b6499203862a5002df284"},"code":"0","msg":"正确返回数据"}';
        insert log;

        System.Test.StartTest();
        Id execBTId = Database.executeBatch(new NFM501TIDetailHistoryDataBatch(log.Id));
        System.Test.StopTest(); 
    }
}