+ Start a Discussion
Lujan GalvanoLujan Galvano 

Test class error data type. please help me!!

Hello!
I developed an apex class for read cases and send email if meet the criteria. It has 100% code coverage, but when I send the test class to production I have the following error:
"Invalid type: NotifCasosSchedule"

This is the test class:
@isTest
public class NotifCasosScheduleTest {
    public static testmethod void test1(){
        Test.startTest();
       
        ID Owner = '00540000004ADl6';
        Case ccs = new Case();
        ccs.Area__c = 'Sistemas';
        ccs.Tipo_de_Caso__c = 'Soporte Salesforce';
        ccs.OwnerId = Owner;
        ccs.Subject = 'test';
        ccs.Description = 'Testeo';
        ccs.CreatedDate__c = System.Date.today()-3;
        insert ccs;
        
        String CRON_EXP = '0 0 0 3 9 ? 2022';
        String jobId = System.schedule('NotifCasosScheduleTest', CRON_EXP, new  NotifCasosSchedule());
        CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE id = :jobId];
        System.assertEquals(0, ct.TimesTriggered);
        System.assertEquals('2022-09-03 00:00:00', String.valueOf(ct.NextFireTime));
        Test.stopTest();

               }
}

any help serves

Thanks!!
Best Regards!!
    
 
Best Answer chosen by Lujan Galvano
Steven NsubugaSteven Nsubuga
You need to deploy both the class and the test class at the same time, together in the same changeset.

All Answers

Steven NsubugaSteven Nsubuga
You need to deploy both the class and the test class at the same time, together in the same changeset.
This was selected as the best answer
Lujan GalvanoLujan Galvano
Thanks a lot!
It works.