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/eSignFormAttachmentControllerTest.cls | 253 --------------------------------------------------
1 files changed, 0 insertions(+), 253 deletions(-)
diff --git a/force-app/main/default/classes/eSignFormAttachmentControllerTest.cls b/force-app/main/default/classes/eSignFormAttachmentControllerTest.cls
index 6bdb193..d2192aa 100644
--- a/force-app/main/default/classes/eSignFormAttachmentControllerTest.cls
+++ b/force-app/main/default/classes/eSignFormAttachmentControllerTest.cls
@@ -125,259 +125,6 @@
attach1.ContentType = 'application/pdf';
attachmentList.add(attach1);
- Attachment attach2=new Attachment();
- attach2.Name='L-65224945-20200928--15.jpg';
- Blob bodyBlob2=Blob.valueOf('Unit Test Attachment Body');
- attach2.body=bodyBlob2;
- attach2.parentId=eSignForm.id;
- attach2.ContentType = 'application/pdf';
- attachmentList.add(attach2);
-
- insert attachmentList;
- PageReference page = new PageReference('/apex/eSignFormAttachment?parentId='+eSignForm.id);
- System.Test.setCurrentPage(page);
-
- eSignFormAttachmentController eSign = new eSignFormAttachmentController();
- eSign.init();
- }
-
- static testMethod void Test02() {
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
- if (rectCo.size() == 0) {
- return;
- }
- List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鎴︾暐绉戝鍒嗛 鍛煎惛绉�'];
- if (rectSct.size() == 0) {
- return;
- }
- List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('瑷虹檪绉� 娑堝寲绉�', '瑷虹檪绉� 鍛煎惛绉�') order by Name desc];
- if (rectDpt.size() == 0) {
- return;
- }
- List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '澶囧搧'];
- if (rectAs.size() == 0) {
- return;
- }
-
-
- // insert hospital
- Account company1 = new Account();
- company1.RecordTypeId = rectCo[0].Id;
- company1.Name = '鐥呴櫌銉嗐偣銉�1';
- company1.OCM_man_province_txt__c = '姹熻タ';
- List<Account> hps = new Account[]{company1};
- insert hps;
-
- List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c];
-
- Account depart1 = new Account();
- depart1.RecordTypeId = rectDpt[0].Id;
- depart1.Name = '*';
- depart1.Department_Name__c = '瑷虹檪绉�1';
- depart1.ParentId = dc1s[0].Id;
- depart1.Department_Class__c = dc1s[0].Id;
- depart1.Hospital__c = company1.Id;
- depart1.OCM_man_province_txt__c = '姹熻タ';
-
- insert new Account[] {depart1};
-
- List<Product2> prdList = new List<Product2>();
- Product2 prd1 = new Product2();
- prd1.ProductCode_Ext__c = 'HistoryPrd1';
- prd1.ProductCode = 'HistoryPrd1';
- prd1.Repair_Product_Code__c = 'HistoryPrd1_RP';
- prd1.Name = 'HistoryPrd1';
- prd1.Manual_Entry__c = false;
- prd1.Extend_new_product_gurantee__c = true;
- prd1.Extend_Gurantee_Start__c = Date.today().addDays(-60);
- prd1.Extend_Gurantee_End__c = Date.today().addDays(60);
- prdList.add(prd1);
- insert prdList;
-
- Asset ast = new Asset();
-
- ast.RecordTypeId = rectAs[0].Id;
- ast.SerialNumber = 'abcdefg';
- ast.Name = '娴嬭瘯璧勪骇1';
- ast.AccountId = depart1.Id;
- ast.Department_Class__c = dc1s[0].Id;
- ast.Hospital__c = company1.Id;
- ast.Product2Id = prd1.Id;
- ast.Guarantee_period_for_products__c = Date.today();
- ast.InstallDate = Date.today();
- ast.Manage_type__c = '涓綋绠$悊';
- ast.FirstApproveDate_old__c = Date.today().addDays(-30);
-
- Oly_TriggerHandler.bypass('AssetHandler');
-
- insert ast;
-
- Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id];
-
- String RecordTypeID = ast1.RecordTypeID__c;
-
- System.assertEquals(RecordTypeID , ast.RecordTypeId);
-
- RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ];
- Opportunity opp = new Opportunity(
- Name='testOpp1',
- StageName='寮曞悎',
- CloseDate=Date.today(),
- AccountId=depart1.Id,
- Sales_Root__c = '璨╁2搴�',
- Competitor__c ='A',
- Click_Close_Date__c = null,
- RecordType = rectOpp
- );
- insert opp;
-
- //娉ㄦ畫
- Statu_Achievements__c Sac = new Statu_Achievements__c(
- name = 'zhucan_one',
- Opportunity__c = opp.id,
- DeliveryDate__c = Date.today(),
- ContractNO__c = 'ContractNO1',
- ContractAmount__c = 1000
- );
- insert Sac;
-
- //鏂板缓鐢靛瓙绛炬敹鍗�
- eSignForm__c eSignForm = new eSignForm__c();
- eSignForm.Statu_Achievements__c = Sac.Id;
- eSignForm.Name = '::娴嬭瘯鐢靛瓙绛炬敹鍗�';
- eSignForm.DNName__c = '112233';
-
- insert eSignForm;
- list<Attachment> attachmentList = new list<Attachment>();
- Attachment attach=new Attachment();
- attach.Name='A-65224941-20200923--1.docx';
- Blob bodyBlob=Blob.valueOf('Unit Test Attachment Body');
- attach.body=bodyBlob;
- attach.parentId=eSignForm.id;
- attach.ContentType = 'application/pdf';
- attachmentList.add(attach);
- insert attachmentList;
- PageReference page = new PageReference('/apex/eSignFormAttachment?parentId='+eSignForm.id);
- System.Test.setCurrentPage(page);
-
- eSignFormAttachmentController eSign = new eSignFormAttachmentController();
- eSign.init();
- }
- static testMethod void Test03() {
- List<RecordType> rectCo = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鐥呴櫌'];
- if (rectCo.size() == 0) {
- return;
- }
- List<RecordType> rectSct = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = '鎴︾暐绉戝鍒嗛 鍛煎惛绉�'];
- if (rectSct.size() == 0) {
- return;
- }
- List<RecordType> rectDpt = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Account' and Name IN ('瑷虹檪绉� 娑堝寲绉�', '瑷虹檪绉� 鍛煎惛绉�') order by Name desc];
- if (rectDpt.size() == 0) {
- return;
- }
- List<RecordType> rectAs = [select Id, Name from RecordType where IsActive = true and SobjectType = 'Asset' and Name = '澶囧搧'];
- if (rectAs.size() == 0) {
- return;
- }
-
-
- // insert hospital
- Account company1 = new Account();
- company1.RecordTypeId = rectCo[0].Id;
- company1.Name = '鐥呴櫌銉嗐偣銉�1';
- company1.OCM_man_province_txt__c = '姹熻タ';
- List<Account> hps = new Account[]{company1};
- insert hps;
-
- List<Account> dc1s = [Select Id, Name, Department_Class_Label__c, Sys_Dept_Name_Change_Chk__c from Account where Parent.Id = :company1.Id order by Department_Class_Label__c];
-
- Account depart1 = new Account();
- depart1.RecordTypeId = rectDpt[0].Id;
- depart1.Name = '*';
- depart1.Department_Name__c = '瑷虹檪绉�1';
- depart1.ParentId = dc1s[0].Id;
- depart1.Department_Class__c = dc1s[0].Id;
- depart1.Hospital__c = company1.Id;
- depart1.OCM_man_province_txt__c = '姹熻タ';
-
- insert new Account[] {depart1};
-
- List<Product2> prdList = new List<Product2>();
- Product2 prd1 = new Product2();
- prd1.ProductCode_Ext__c = 'HistoryPrd1';
- prd1.ProductCode = 'HistoryPrd1';
- prd1.Repair_Product_Code__c = 'HistoryPrd1_RP';
- prd1.Name = 'HistoryPrd1';
- prd1.Manual_Entry__c = false;
- prd1.Extend_new_product_gurantee__c = true;
- prd1.Extend_Gurantee_Start__c = Date.today().addDays(-60);
- prd1.Extend_Gurantee_End__c = Date.today().addDays(60);
- prdList.add(prd1);
- insert prdList;
-
- Asset ast = new Asset();
-
- ast.RecordTypeId = rectAs[0].Id;
- ast.SerialNumber = 'abcdefg';
- ast.Name = '娴嬭瘯璧勪骇1';
- ast.AccountId = depart1.Id;
- ast.Department_Class__c = dc1s[0].Id;
- ast.Hospital__c = company1.Id;
- ast.Product2Id = prd1.Id;
- ast.Guarantee_period_for_products__c = Date.today();
- ast.InstallDate = Date.today();
- ast.Manage_type__c = '涓綋绠$悊';
- ast.FirstApproveDate_old__c = Date.today().addDays(-30);
-
- Oly_TriggerHandler.bypass('AssetHandler');
-
- insert ast;
-
- Asset ast1 = [select RecordTypeID__c from Asset where Id =: ast.Id];
-
- String RecordTypeID = ast1.RecordTypeID__c;
-
- System.assertEquals(RecordTypeID , ast.RecordTypeId);
-
- RecordType rectOpp = [select id from RecordType where IsActive = true and SobjectType = 'Opportunity' and DeveloperName = 'Opportunity' ];
- Opportunity opp = new Opportunity(
- Name='testOpp1',
- StageName='寮曞悎',
- CloseDate=Date.today(),
- AccountId=depart1.Id,
- Sales_Root__c = '璨╁2搴�',
- Competitor__c ='A',
- Click_Close_Date__c = null,
- RecordType = rectOpp
- );
- insert opp;
-
- //娉ㄦ畫
- Statu_Achievements__c Sac = new Statu_Achievements__c(
- name = 'zhucan_one',
- Opportunity__c = opp.id,
- DeliveryDate__c = Date.today(),
- ContractNO__c = 'ContractNO1',
- ContractAmount__c = 1000
- );
- insert Sac;
-
- //鏂板缓鐢靛瓙绛炬敹鍗�
- eSignForm__c eSignForm = new eSignForm__c();
- eSignForm.Statu_Achievements__c = Sac.Id;
- eSignForm.Name = '::娴嬭瘯鐢靛瓙绛炬敹鍗�';
- eSignForm.DNName__c = '112233';
-
- insert eSignForm;
- list<Attachment> attachmentList = new list<Attachment>();
- Attachment attach1=new Attachment();
- attach1.Name='H-65224945-20200928--15.jpg';
- Blob bodyBlob1=Blob.valueOf('Unit Test Attachment Body');
- attach1.body=bodyBlob1;
- attach1.parentId=eSignForm.id;
- attach1.ContentType = 'application/pdf';
- attachmentList.add(attach1);
insert attachmentList;
PageReference page = new PageReference('/apex/eSignFormAttachment?parentId='+eSignForm.id);
System.Test.setCurrentPage(page);
--
Gitblit v1.9.1