@isTest(SeeAllData=false)
|
private class SetCurrentDailyReportSumTest {
|
|
|
|
static testMethod void test_method_schedule() {
|
// Implement test code
|
Daily_Report__c dr = new Daily_Report__c();
|
dr.Reported_Date__c = Date.today();
|
dr.Reporter__c = UserInfo.getUserId();
|
dr.Status__c = '申請中';
|
insert dr;
|
|
String CRON_EXP = '0 0 0 3 9 ? 2032';
|
system.schedule('SetCurrentDailyReportSumTest', CRON_EXP, new SetCurrentDailyReportSumSchedule());
|
}
|
|
static testMethod void test_method_one() {
|
// Implement test code
|
Daily_Report__c dr = new Daily_Report__c();
|
dr.Reported_Date__c = Date.newInstance(Date.today().year()-1, 9, 1);
|
dr.Reporter__c = UserInfo.getUserId();
|
dr.Status__c = '申請中';
|
insert dr;
|
|
Id execBTId = Database.executeBatch(new SetCurrentDailyReportSumBatch(Date.newInstance(Date.today().year()-1, 10, 1), UserInfo.getUserId()), 20);
|
}
|
|
static testMethod void test_method_two() {
|
// Implement test code
|
Daily_Report__c dr = new Daily_Report__c();
|
dr.Reported_Date__c = Date.newInstance(Date.today().year()-1, 9, 1);
|
dr.Reporter__c = UserInfo.getUserId();
|
dr.Status__c = '申請中';
|
insert dr;
|
|
Id execBTId = Database.executeBatch(new SetCurrentDailyReportSumBatch(Date.newInstance(Date.today().year(), 3, 1), UserInfo.getUserId()), 20);
|
}
|
|
static testMethod void test_method_three() {
|
// Implement test code
|
Daily_Report__c dr = new Daily_Report__c();
|
dr.Reported_Date__c = Date.newInstance(Date.today().year()-1, 7, 1);
|
dr.Reporter__c = UserInfo.getUserId();
|
dr.Status__c = '申請中';
|
insert dr;
|
Test.startTest();
|
Id execBTId = Database.executeBatch(new SetCurrentDailyReportSumBatch(Date.newInstance(Date.today().year()+1, 4, 1), UserInfo.getUserId()), 20);
|
Test.stopTest();
|
}
|
@isTest
|
PUBLIC static void test_method_four() {
|
StaticParameter.EventOpportunityPileUpExeFlg = true;
|
// EventC⇒Event処理後、逆更新をスルー用
|
StaticParameter.NotUpdEventCFlg = true;
|
// 積み上げ処理後、トリガをスルー用
|
StaticParameter.EscapeNFM001Trigger = true;
|
StaticParameter.EscapeNFM001AgencyContractTrigger = true;
|
StaticParameter.EscapeNFM001AgencyContractTrigger2 = true;
|
StaticParameter.EscapeNFM007Trigger = true;
|
StaticParameter.EscapeOpportunityBefUpdTrigger = true;
|
StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true;
|
StaticParameter.EscapeSyncOpportunityTrigger = true;
|
StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true;
|
StaticParameter.EscapeSyncProduct2Trigger = true;
|
// trueのとき、リードのトリガーをスルーする
|
StaticParameter.EscapeLeadTrigger = true;
|
StaticParameter.EscapeAccountTrigger = true;
|
|
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
|
|
StaticParameter.EscapeNFM010UpsertStatuAchievementsTrigger = true;
|
// 直销耗材不直销 ConsumableAssetHander
|
StaticParameter.ConsumableAssetHanderTrigger = true;
|
|
// 跳过不涉及备品借出的逻辑
|
StaticParameter.rentalApplyIsRunning = true;
|
|
// accountdailyUpdate 跳过 更新询价
|
StaticParameter.EscapeOpportunityownerUpdate = true;
|
// Implement test code
|
// Daily_Report__c dr = new Daily_Report__c();
|
// dr.Reported_Date__c = Date.newInstance(Date.today().year()-1, 7, 1);
|
// dr.Reporter__c = UserInfo.getUserId();
|
// dr.Status__c = '申請中';
|
// insert dr;
|
|
Test.startTest();
|
Id execBTId = Database.executeBatch(new SetCurrentDailyReportSumBatch(152,UserInfo.getUserId()),1);
|
Test.stopTest();
|
|
|
}
|
@isTest
|
PUBLIC static void test_method_five() {
|
StaticParameter.EventOpportunityPileUpExeFlg = true;
|
// EventC⇒Event処理後、逆更新をスルー用
|
StaticParameter.NotUpdEventCFlg = true;
|
// 積み上げ処理後、トリガをスルー用
|
StaticParameter.EscapeNFM001Trigger = true;
|
StaticParameter.EscapeNFM001AgencyContractTrigger = true;
|
StaticParameter.EscapeNFM001AgencyContractTrigger2 = true;
|
StaticParameter.EscapeNFM007Trigger = true;
|
StaticParameter.EscapeOpportunityBefUpdTrigger = true;
|
StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true;
|
StaticParameter.EscapeSyncOpportunityTrigger = true;
|
StaticParameter.EscapeMaintenanceContractAfterUpdateTrigger = true;
|
StaticParameter.EscapeSyncProduct2Trigger = true;
|
// trueのとき、リードのトリガーをスルーする
|
StaticParameter.EscapeLeadTrigger = true;
|
StaticParameter.EscapeAccountTrigger = true;
|
|
StaticParameter.EscapeConsumableOrderDetail2Trigger = true;
|
|
StaticParameter.EscapeNFM010UpsertStatuAchievementsTrigger = true;
|
// 直销耗材不直销 ConsumableAssetHander
|
StaticParameter.ConsumableAssetHanderTrigger = true;
|
|
// 跳过不涉及备品借出的逻辑
|
StaticParameter.rentalApplyIsRunning = true;
|
|
// accountdailyUpdate 跳过 更新询价
|
StaticParameter.EscapeOpportunityownerUpdate = true;
|
// Implement test code
|
// Daily_Report__c dr = new Daily_Report__c();
|
// dr.Reported_Date__c = Date.newInstance(Date.today().year()-1, 7, 1);
|
// dr.Reporter__c = UserInfo.getUserId();
|
// dr.Status__c = '申請中';
|
// insert dr;
|
|
Test.startTest();
|
Id execBTId = Database.executeBatch(new SetCurrentDailyReportSumBatch(UserInfo.getUserId()),1);
|
|
Test.stopTest();
|
|
|
}
|
|
|
}
|