| | |
| | | @isTest(SeeAllData=false) |
| | | @isTest() |
| | | private class InquiryVerifyBatchTest { |
| | | |
| | | private static String quoteNo = 'textQutote01'; |
| | |
| | | private static Date createdDateStr = Date.today(); |
| | | |
| | | static testMethod void testMethod1() { |
| | | InitData(); |
| | | // System.Test.StartTest(); |
| | | // try { |
| | | ID exid = Database.executeBatch(new InquiryVerifyBatch(),1); |
| | | // System.abortJob(exid); |
| | | // } catch(Exception e){ |
| | | |
| | | // } |
| | | // System.Test.StopTest(); |
| | | InitData(); |
| | | ID exid = Database.executeBatch(new InquiryVerifyBatch(),200); |
| | | // System.Test.StopTest(); |
| | | } |
| | | static testMethod void testMethod2(){ |
| | | System.Test.StartTest(); |
| | | InquiryVerifyBatch bct1 = new InquiryVerifyBatch(2022,4); |
| | | System.schedule('Scheduled Job 5', '0 45 * * * ?', bct1); |
| | | System.Test.StopTest(); |
| | | } |
| | | |
| | | private static void InitData() { |
| | | User user = new User(Test_staff__c = true); |
| | | // Oly_TriggerHandler.bypass('AWSServiceTool2'); |
| | | Oly_TriggerHandler.bypass('ContactTriggerHandler'); |
| | | // Oly_TriggerHandler.bypass('PIHelper'); |
| | | User user = new User(); |
| | | user.LastName = '_サンブリッジ'; |
| | | user.FirstName = 'う'; |
| | | user.Alias = 'う'; |
| | |
| | | user.Username = 'olympusTest03@sunbridge.com'; |
| | | user.CommunityNickname = 'う'; |
| | | user.IsActive = true; |
| | | user.Employee_No__c = 'om009238'; |
| | | user.EmailEncodingKey = 'ISO-2022-JP'; |
| | | user.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | user.LocaleSidKey = 'ja_JP'; |
| | |
| | | StaticParameter.EscapeOpportunityHpDeptUpdTrigger = true; |
| | | StaticParameter.EscapeSyncOpportunityTrigger = true; |
| | | |
| | | System.runAs(new User(Id = Userinfo.getUserId())) { |
| | | Oly_TriggerHandler.bypass('UserToContact'); |
| | | insert user; |
| | | // テストデータ |
| | | System.runAs(user){ |
| | | Account company = new Account(); |
| | | company.RecordTypeId = rectCo[0].Id; |
| | | company.Name = 'NFM007TestCompany'; |
| | |
| | | depart.ParentId = section.Id; |
| | | depart.Department_Class__c = section.Id; |
| | | depart.Hospital__c = company.Id; |
| | | section.AgentCode_Ext__c = '9999900'; |
| | | depart.AgentCode_Ext__c = '99999001'; |
| | | insert depart; |
| | | |
| | | Opportunity opp = new Opportunity(); |
| | |
| | | prd1.Category4__c = 'CV'; |
| | | prd1.Category5__c = '260SL系列'; |
| | | prd1.Asset_Model_No__c = '1001'; |
| | | prd1.Important_product__c = true; |
| | | prd1.Important_Rroduct_1GI__c = true; |
| | | insert prd1; |
| | | |
| | | |
| | | System.assertEquals(prd1.Important_product__c,true); |
| | | |
| | | PricebookEntry entry = new PricebookEntry(Pricebook2Id = pricebookId, Product2Id = prd1.Id); |
| | | entry.UnitPrice = 0; |
| | |
| | | entry.UseStandardPrice = false; |
| | | entry.CurrencyIsoCode = 'CNY'; |
| | | insert entry; |
| | | |
| | | System.assertEquals(prd1.Important_product__c,true); |
| | | List<Quote> qList = [Select Id, CurrencyIsoCode from Quote where Id = : quote.Id]; |
| | | System.assertEquals(1, qList.size()); |
| | | System.assertEquals('CNY', qList[0].CurrencyIsoCode); |
| | | |
| | | QuoteLineItem target = new QuoteLineItem(); |
| | | target.Name__c = 'テスト商品'; |
| | | target.QuoteId = quote.Id; |
| | | target.QuoteId = quote.id; |
| | | target.Quantity = 1; |
| | | target.Cost_Subtotal__c = 0; |
| | | target.Cost__c = 200; |
| | |
| | | target.Product2Id = prd1.id; |
| | | target.PricebookEntryId = entry.Id; |
| | | insert target; |
| | | |
| | | prd1.Important_product__c = true; |
| | | update prd1; |
| | | System.assertEquals(prd1.Important_product__c,true); |
| | | // System.assertEquals(target.Product2.Important_product__c,true); |
| | | system.assertEquals(target.Product2Id,prd1.id); |
| | | List<QuoteLineItem> qlts = [Select Id,Product2.Important_product__c,QuoteId from QuoteLineItem where id = :target.id]; |
| | | System.assertEquals(qlts[0].Product2.Important_product__c,true); |
| | | System.assertEquals(qlts[0].QuoteId,quote.id); |
| | | Consumable_order_details2__c saledet1 = new Consumable_order_details2__c(); |
| | | saledet1.Name = 'OCM_01_001001'; |
| | | // saledet1.Consumable_order_minor__c = Order1.Id; |
| | |
| | | String flag='NG2'; |
| | | String d1='产品试用'; |
| | | String dept='医疗华北营业本部'; |
| | | // User user = new User(Test_staff__c = true); |
| | | // user.LastName = '_サンブリッジ'; |
| | | // user.FirstName = 'う'; |
| | | // user.Alias = 'う'; |
| | | // user.Email = 'olympusTest03@sunbridge.com'; |
| | | // user.Username = 'olympusTest03@sunbridge.com'; |
| | | // user.CommunityNickname = 'う'; |
| | | // user.IsActive = true; |
| | | // user.EmailEncodingKey = 'ISO-2022-JP'; |
| | | // user.TimeZoneSidKey = 'Asia/Tokyo'; |
| | | // user.LocaleSidKey = 'ja_JP'; |
| | | // user.LanguageLocaleKey = 'ja'; |
| | | // user.ProfileId = System.Label.ProfileId_SystemAdmin; |
| | | // user.Province__c = '北京'; |
| | | // user.Dept__c = dept; |
| | | // user.Use_Start_Date__c = Date.today().addMonths(-6); |
| | | // insert user; |
| | | |
| | | |
| | | FixtureDeliverySlip__c fdsObj = new FixtureDeliverySlip__c(); |
| | | fdsObj.Name = '00001'; |