From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新
---
force-app/main/default/classes/PowerBIUpdateBatchTest.cls | 55 +++++++++++--------------------------------------------
1 files changed, 11 insertions(+), 44 deletions(-)
diff --git a/force-app/main/default/classes/PowerBIUpdateBatchTest.cls b/force-app/main/default/classes/PowerBIUpdateBatchTest.cls
index ab1926c..accac94 100644
--- a/force-app/main/default/classes/PowerBIUpdateBatchTest.cls
+++ b/force-app/main/default/classes/PowerBIUpdateBatchTest.cls
@@ -30,10 +30,10 @@
insert(oliset);
}
- static testMethod void myUnitTest() {
+ static testMethod void myUnitTest() {
setuserset();
- Opportunity opp1 = new Opportunity(Name='aiueo1', StageName='寮曞悎', CurrencyIsoCode='CNY', CloseDate=Date.today());
+ Opportunity opp1 = new Opportunity(Name='aiueo1', StageName='寮曞悎', CurrencyIsoCode='CNY', CloseDate=Date.today());
insert opp1;
PricebookEntry entryCNY = buildPB('CNY');
@@ -41,52 +41,19 @@
OpportunityLineItem oli1 = new OpportunityLineItem(OpportunityId=opp1.Id, Name__c='oli1', Quantity=21, UnitPrice=100, PricebookEntryId=entryCNY.Id);
insert oli1;
- List<BI_OpportunityLineItem__c> bi_oli1 = [select id, ShareWithPowerBI__c, ShareWithPowerBIFormula__c, ShareWithPowerBI_NeedUpd__c from BI_OpportunityLineItem__c where OpportunityId__c = :opp1.Id];
-
- //System.assertEquals(true, bi_oli1[0].ShareWithPowerBI__c);
- //System.assertEquals(true, bi_oli1[0].ShareWithPowerBIFormula__c);
- //System.assertEquals(false, bi_oli1[0].ShareWithPowerBI_NeedUpd__c);
+ BI_OpportunityLineItem__c bi_oli1 = [select id, ShareWithPowerBI__c, ShareWithPowerBIFormula__c, ShareWithPowerBI_NeedUpd__c from BI_OpportunityLineItem__c where OpportunityId__c = :opp1.Id];
+ System.assertEquals(true, bi_oli1.ShareWithPowerBI__c);
+ System.assertEquals(true, bi_oli1.ShareWithPowerBIFormula__c);
+ System.assertEquals(false, bi_oli1.ShareWithPowerBI_NeedUpd__c);
opp1.StageName = '鍑鸿嵎';
update opp1;
- List<BI_OpportunityLineItem__c> bi_oli2 = [select id, ShareWithPowerBI__c, ShareWithPowerBIFormula__c, ShareWithPowerBI_NeedUpd__c from BI_OpportunityLineItem__c where OpportunityId__c = :opp1.Id];
- //System.assertEquals(true, bi_oli2.ShareWithPowerBI__c);
- //System.assertEquals(false, bi_oli2.ShareWithPowerBIFormula__c);
- //System.assertEquals(true, bi_oli2.ShareWithPowerBI_NeedUpd__c);
+ BI_OpportunityLineItem__c bi_oli2 = [select id, ShareWithPowerBI__c, ShareWithPowerBIFormula__c, ShareWithPowerBI_NeedUpd__c from BI_OpportunityLineItem__c where OpportunityId__c = :opp1.Id];
+ System.assertEquals(true, bi_oli2.ShareWithPowerBI__c);
+ System.assertEquals(false, bi_oli2.ShareWithPowerBIFormula__c);
+ System.assertEquals(true, bi_oli2.ShareWithPowerBI_NeedUpd__c);
Id execBTId = Database.executeBatch(new PowerBIUpdateBatch(opp1.Id), 100);
- }
-
- // 2021-03-11 mzy add SFDC鍚堝苟璋冩煡Batch start
- static testMethod void myUnitTest2() {
- setuserset();
-
- Opportunity opp1 = new Opportunity(Name='aiueo1', StageName='寮曞悎', CurrencyIsoCode='CNY', CloseDate=Date.today());
- insert opp1;
-
- PricebookEntry entryCNY = buildPB('CNY');
-
- OpportunityLineItem oli1 = new OpportunityLineItem(OpportunityId=opp1.Id, Name__c='oli1', Quantity=21, UnitPrice=100, PricebookEntryId=entryCNY.Id);
- insert oli1;
-
- opp1.StageName = '瀹屼簡';
- update opp1;
-
- BI_OpportunityLineItem__c bo = new BI_OpportunityLineItem__c();
- bo.OpportunityId__c = opp1.Id;
- bo.Name = 'testBI';
- bo.PowerBI_Source_Id__c = '00k1000000rHneEAAz';
- bo.ShareWithPowerBI__c = true;
- insert bo;
-
- //System.assertEquals(null, bo.ShareWithPowerBIFormula__c); //false
- //System.assertEquals(false, bo.ShareWithPowerBI__c); //true
- //System.assertEquals(false, bo.ShareWithPowerBI_NeedUpd__c);
-
- List<BI_OpportunityLineItem__c> bi_oli1 = [select id, ShareWithPowerBI__c, ShareWithPowerBIFormula__c, ShareWithPowerBI_NeedUpd__c from BI_OpportunityLineItem__c where OpportunityId__c = :opp1.Id];
-
- Id execBTId = Database.executeBatch(new PowerBIUpdateBatch(true), 100);
- }
- // 2021-03-11 mzy add SFDC鍚堝苟璋冩煡Batch end
+ }
}
\ No newline at end of file
--
Gitblit v1.9.1