| | |
| | | private static String agentName = 'test agent name'; |
| | | |
| | | static testMethod void TestInit01() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | system.debug('---------------------------------------Start initTest-----'); |
| | | NewQuoteEntryController QuotePage = new NewQuoteEntryController(); |
| | | //Line 119 UserのQuote_Correct__c、Quote_Special_Operation__c、SAP_Send_OFF__cをテストため。 |
| | |
| | | } |
| | | |
| | | static testMethod void testInit02() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | system.debug('---------------------------------------Start initTest-----'); |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, Batch_User__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | |
| | | } |
| | | |
| | | static testMethod void testInit02_01() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, Batch_User__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | system.runAs(MacOwner) { |
| | |
| | | // } |
| | | |
| | | static testMethod void testInit02_2_01() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | system.debug('---------------------------------------Start initTest-----'); |
| | | NewQuoteEntryController QuotePage = new NewQuoteEntryController(); |
| | | //Line 119 UserのQuote_Correct__c、Quote_Special_Operation__c、SAP_Send_OFF__cをテストため。 |
| | |
| | | // } |
| | | |
| | | static testMethod void testInit04() { |
| | | ControllerUtil.EscapeNFM001Trigger = true; |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, Batch_User__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | system.runAs(MacOwner) { |
| | |
| | | } |
| | | } |
| | | static testMethod void testInit04_01() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, Batch_User__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | system.runAs(MacOwner) { |
| | |
| | | } |
| | | |
| | | static testMethod void testInit04_2() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, Batch_User__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | system.runAs(MacOwner) { |
| | |
| | | } |
| | | |
| | | static testMethod void testInit04_2_01() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | NewQuoteEntryController QuotePage = new NewQuoteEntryController(); |
| | | String userId = UserInfo.getUserId(); |
| | | User u1 = [SELECT Id, Quote_Correct__c, Quote_Special_Operation__c, Cost_Referable__c FROM User WHERE Id = :userId]; |
| | |
| | | //見積データ検索 |
| | | opprtunity = [SElECT Id, Opportunity_no__c, CurrencyIsoCode FROM Opportunity WHERE Id = :opp.id]; |
| | | |
| | | //test7( opp, quote , QuotePage); |
| | | test7( opp, quote , QuotePage); |
| | | System.Test.stopTest(); |
| | | } |
| | | static testMethod void TestInit05() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | system.debug('---------------------------------------Start initTest-----'); |
| | | NewQuoteEntryController QuotePage = new NewQuoteEntryController(); |
| | | //Line 119 UserのQuote_Correct__c、Quote_Special_Operation__c、SAP_Send_OFF__cをテストため。 |
| | |
| | | |
| | | delete quote; |
| | | |
| | | Product2 product1 = new Product2( Name = 'テスト商品'); |
| | | Product2 product1 = new Product2( Name = 'テスト商品', ProductCode = 'TST1000001', Asset_Model_No__c = 'TST1000001'); |
| | | insert product1; |
| | | system.debug('##product.Id=[' + product1.Id + ']' ); |
| | | |
| | |
| | | |
| | | // delete quote; |
| | | |
| | | Product2 product1 = new Product2( Name = 'テスト商品'); |
| | | Product2 product1 = new Product2( Name = 'テスト商品', ProductCode = 'TST1101101', Asset_Model_No__c = 'TST1101101', LastbuyProductFLG__c = true); |
| | | insert product1; |
| | | system.debug('##product.Id=[' + product1.Id + ']' ); |
| | | |
| | |
| | | } |
| | | } |
| | | static testMethod void check_QuoteEntryController001() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | |
| | | RecordType recByoin = [select id from RecordType where IsActive = true and SobjectType = 'Account' and Name = :RC_BYOUIN limit 1]; |
| | | Account hospital = new Account(Name = 'テスト病院'); |
| | |
| | | controller.quoId = null; |
| | | controller.enableSales = false; |
| | | controller.init(); |
| | | product2.Name = '11122'; |
| | | update product2; |
| | | controller.init(); |
| | | controller.quo.MultiYearWarrantyTotalPrice__c = 1000; |
| | | controller.dataCheck(); |
| | | controller.select_index = 0; |
| | |
| | | } |
| | | //测试程序 测外贸 精琢技术 wql 2021/02/20 start |
| | | static testMethod void check_QuoteEntryController002() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | |
| | | RecordType recByoin = [select id from RecordType where IsActive = true and SobjectType = 'Account' and Name = :RC_BYOUIN limit 1]; |
| | | Account hospital = new Account(Name = 'テスト病院'); |
| | |
| | | system.runAs(MacOwner) { |
| | | Opportunity opp = new Opportunity( Name = 'aiueo', StageName = 'contact', CloseDate = Date.today()); |
| | | opp.Trade__c = '外貿'; |
| | | opp.CurrencyIsoCode = CurrencyIso; |
| | | opp.CurrencyIsoCode = 'USD'; |
| | | opp.Sales_Root__c = '販売店'; |
| | | opp.StageName = '引合'; |
| | | opp.owner_not_automatically_update__c = true; |
| | |
| | | Apexpages.currentPage().getParameters().put('oppid', opp.id); |
| | | NewQuoteEntryController controller = new NewQuoteEntryController(); |
| | | //Apexpages.currentPage().getParameters().put('id', quote.id); |
| | | controller.oppId = null; |
| | | controller.quoId = null; |
| | | controller.oppId = opp.id; |
| | | controller.quoId = quote.id; |
| | | controller.enableSales = false; |
| | | controller.init(); |
| | | controller.ReservedProductVerification(); |
| | | controller.quo.MultiYearWarrantyTotalPrice__c = 1000; |
| | | controller.dataCheck(); |
| | | controller.select_index = 0; |
| | |
| | | } |
| | | |
| | | static testMethod void dataEntryTest() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, Batch_User__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | system.runAs(MacOwner) { |
| | |
| | | |
| | | //测试阿西赛多 测试程序 精琢技术 wql 2021/02/20 start |
| | | static testMethod void check_QuoteEntryController003() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | |
| | | RecordType recByoin = [select id from RecordType where IsActive = true and SobjectType = 'Account' and Name = :RC_BYOUIN limit 1]; |
| | | Account hospital = new Account(Name = 'テスト病院'); |
| | |
| | | |
| | | //20211015 lt start |
| | | static testMethod void check_QuoteEntryController004() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | |
| | | RecordType recByoin = [select id from RecordType where IsActive = true and SobjectType = 'Account' and Name = :RC_BYOUIN limit 1]; |
| | | Account hospital = new Account(Name = 'テスト病院'); |
| | |
| | | } |
| | | |
| | | static testMethod void dataEntryTest1() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | Profile p = [select Id from Profile where id = :System.Label.ProfileId_SystemAdmin]; |
| | | User MacOwner = new User(Test_staff__c = true, Batch_User__c = true, LastName = 'hp1', FirstName = 'owner1', Alias = 'hp', CommunityNickname = 'hpOwner1', Email = 'olympus_hpowner@sunbridge.com', Username = 'olympus_hpowner@sunbridge.com1', IsActive = true, EmailEncodingKey = 'ISO-2022-JP', TimeZoneSidKey = 'Asia/Tokyo', LocaleSidKey = 'ja_JP', LanguageLocaleKey = 'ja', ProfileId = p.id); |
| | | system.runAs(MacOwner) { |
| | |
| | | //controller.dataEntry(); |
| | | //controller.dataCheck(); |
| | | controller.QuoteDecision(); |
| | | controller.quoId = quote.id; |
| | | controller.Print(); |
| | | |
| | | actList = new List<NewQuoteEntryController.QELine>(); |
| | |
| | | } |
| | | //20211015 lt end |
| | | static testMethod void dataEntryTest2() { |
| | | StaticParameter.EscapeOppandStaTrigger = true; |
| | | RecordType recByoin = [select id from RecordType where IsActive = true and SobjectType = 'Account' and Name = :RC_BYOUIN limit 1]; |
| | | Account hospital = new Account(Name = 'テスト病院'); |
| | | hospital.RecordTypeId = recByoin.id; |