From 64b3629116e6f3f5eb3debf9b451d100f4010fa5 Mon Sep 17 00:00:00 2001 From: 游畅 <youchang@prec-tech.com> Date: 星期五, 22 四月 2022 13:50:56 +0800 Subject: [PATCH] 询问单相关修改 --- force-app/main/default/classes/StatusPageControllerTest.cls | 118 ++++++++++++++++++++++++++++++---------------------------- 1 files changed, 61 insertions(+), 57 deletions(-) diff --git a/force-app/main/default/classes/StatusPageControllerTest.cls b/force-app/main/default/classes/StatusPageControllerTest.cls index 5c4011f..7416c85 100644 --- a/force-app/main/default/classes/StatusPageControllerTest.cls +++ b/force-app/main/default/classes/StatusPageControllerTest.cls @@ -3,7 +3,7 @@ static testMethod void testMethod1() { //鍖婚櫌 - List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; + List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; if (rectHp.size() == 0) { return; } @@ -14,16 +14,16 @@ } - Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; + Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; - User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner; - User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner2; + User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner; + User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner2; - Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); + Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); hp.FSE_GI_Main_Leader__c = hpOwner.Id; hp.FSE_SP_Main_Leader__c = hpOwner2.Id; insert hp; @@ -64,15 +64,16 @@ Test.startTest(); insert inquiryform; PageReference page = new PageReference('/apex/StatusPage?id='+inquiryform.Id); - System.Test.setCurrentPage(page); - StatusPageController controller = new StatusPageController(); - controller.init(); - controller.save(); - controller.savefo(); + System.Test.setCurrentPage(page); + StatusPageController controller = new StatusPageController(); + controller.init(); + controller.save(); + controller.savefo(); + controller.servicesavefo(); } static testMethod void testMethod2() { //鍖婚櫌 - List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; + List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; if (rectHp.size() == 0) { return; } @@ -83,16 +84,16 @@ } - Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; + Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; - User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner; - User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner2; + User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner; + User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner2; - Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); + Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); hp.FSE_GI_Main_Leader__c = hpOwner.Id; hp.FSE_SP_Main_Leader__c = hpOwner2.Id; insert hp; @@ -134,15 +135,16 @@ Test.startTest(); insert inquiryform; PageReference page = new PageReference('/apex/StatusPage?id='+inquiryform.Id); - System.Test.setCurrentPage(page); - StatusPageController controller = new StatusPageController(); - controller.init(); - controller.save(); - controller.savefo(); + System.Test.setCurrentPage(page); + StatusPageController controller = new StatusPageController(); + controller.init(); + controller.save(); + controller.savefo(); + controller.servicesavefo(); } static testMethod void testMethod2_1() { //鍖婚櫌 - List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; + List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; if (rectHp.size() == 0) { return; } @@ -153,16 +155,16 @@ } - Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; + Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; - User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner; - User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner2; + User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner; + User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner2; - Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); + Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); hp.FSE_GI_Main_Leader__c = hpOwner.Id; hp.FSE_SP_Main_Leader__c = hpOwner2.Id; insert hp; @@ -204,14 +206,14 @@ Test.startTest(); insert inquiryform; PageReference page = new PageReference('/apex/StatusPage?id='+inquiryform.Id); - System.Test.setCurrentPage(page); - StatusPageController controller = new StatusPageController(); - controller.init(); - controller.save(); + System.Test.setCurrentPage(page); + StatusPageController controller = new StatusPageController(); + controller.init(); + controller.save(); } static testMethod void testMethod3() { //鍖婚櫌 - List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; + List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; if (rectHp.size() == 0) { return; } @@ -222,16 +224,16 @@ } - Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; + Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; - User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner; - User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner2; + User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner; + User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner2; - Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); + Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); hp.FSE_GI_Main_Leader__c = hpOwner.Id; hp.FSE_SP_Main_Leader__c = hpOwner2.Id; insert hp; @@ -274,14 +276,15 @@ Test.startTest(); insert inquiryform; PageReference page = new PageReference('/apex/FollowPage?id='+inquiryform.Id); - System.Test.setCurrentPage(page); - StatusPageController controller = new StatusPageController(); - controller.init(); - controller.savefo(); + System.Test.setCurrentPage(page); + StatusPageController controller = new StatusPageController(); + controller.init(); + controller.savefo(); + controller.servicesavefo(); } static testMethod void testMethod4() { //鍖婚櫌 - List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; + List<RecordType> rectHp = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and DeveloperName = 'HP']; if (rectHp.size() == 0) { return; } @@ -292,16 +295,16 @@ } - Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; + Profile p = [select Id from Profile where id =:System.Label.ProfileId_SystemAdmin]; - User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner; - User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); - insert hpOwner2; + User hpOwner = new User(Test_staff__c = true, LastName = 'hp', FirstName = 'owner', Alias = 'hp', Work_Location__c = '鍖椾含', CommunityNickname = 'hpOwner', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner; + User hpOwner2 = new User(Test_staff__c = true, LastName = 'hp2', FirstName = 'owner', Alias = 'hp2', Work_Location__c = '閲嶅簡', CommunityNickname = 'hpOwner2', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner2@sunbridge.com', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); + insert hpOwner2; - Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); + Account hp = new Account(RecordTypeId = rectHp[0].Id, Name = 'hp', OwnerId = hpOwner.Id); hp.FSE_GI_Main_Leader__c = hpOwner.Id; hp.FSE_SP_Main_Leader__c = hpOwner2.Id; insert hp; @@ -344,9 +347,10 @@ Test.startTest(); insert inquiryform; PageReference page = new PageReference('/apex/FollowPage?id='+inquiryform.Id); - System.Test.setCurrentPage(page); - StatusPageController controller = new StatusPageController(); - controller.init(); - controller.savefo(); + System.Test.setCurrentPage(page); + StatusPageController controller = new StatusPageController(); + controller.init(); + controller.savefo(); + controller.servicesavefo(); } } \ No newline at end of file -- Gitblit v1.9.1