You need to sign in to do that
Don't have an account?
vicky rathi
System.ListException: List index out of bounds: -20
Hello Developers
pls help me How to cover these line in test class I am try a lot but not success. MY test code is below
pls help me How to cover these line in test class I am try a lot but not success. MY test code is below
@isTest private class MSDbugScheduleLogHistoryCl_Test { static testMethod void MSDbugScheduleLogHistoryCl_method() { MS_Sync_App__c oMSSyncApp = new MS_Sync_App__c(Name = 'WooCommerce'); insert oMSSyncApp; MS_Connector__c oMSConnector = new MS_Connector__c(Name = 'WooCommArcs', Connector_Type__c = oMSSyncApp.Id); insert oMSConnector; String sConId = ApexPages.currentPage().getParameters().put('conTypeId', oMSSyncApp.Id); MS_Schedule__c oMSSchedule = new MS_Schedule__c(Name = 'Test', Connector__c = oMSConnector.Id); insert oMSSchedule; String sId = ApexPages.currentPage().getParameters().put('ScheduleId', oMSSchedule.Id); MS_Schedule_History__c oMSScheduleHistory = new MS_Schedule_History__c(MS_Schedule__c = oMSSchedule.Id); insert oMSScheduleHistory; String slogId = ApexPages.currentPage().getParameters().put('logid', oMSScheduleHistory.Id); MSDbugScheduleLogHistoryCl oMSDbugScheduleLogHistoryCl = new MSDbugScheduleLogHistoryCl(); oMSDbugScheduleLogHistoryCl.sScheduleId = sId; oMSDbugScheduleLogHistoryCl.slogId = slogId; oMSDbugScheduleLogHistoryCl.sId = oMSScheduleHistory.Id; oMSDbugScheduleLogHistoryCl.beginning(); oMSDbugScheduleLogHistoryCl.next(); oMSDbugScheduleLogHistoryCl.previousRecord(); oMSDbugScheduleLogHistoryCl.last(); oMSDbugScheduleLogHistoryCl.getDisableNext(); oMSDbugScheduleLogHistoryCl.getDisablePrevious(); oMSDbugScheduleLogHistoryCl.Previous(); oMSDbugScheduleLogHistoryCl.Mapping(); oMSDbugScheduleLogHistoryCl.closePopup(); oMSDbugScheduleLogHistoryCl.showPopup(); System.assert(oMSSchedule.Id != null); } }
Please ceate good test data.
Thanks for you reply.
But I stuck how to create the same in testclass or do some changes in controller.