i wan't to make a unit test to cover my method, but he doesn't work and i don't know if i'm on a good way. I have this error : List has no rows for assignment to SObject
And this is my method code :
public static void PB17_EventAddTypeRDV (List <Event> e, String operation) {
for (Event evt : e){
if( operation == 'Before')
{
if (evt.Type != null && evt.Type != evt.Type_RDV__c) {
evt.Type_RDV__c = evt.Type;
}
}
}
}
And my test method :
@istest
static void testEventAddTypeRDV(){
Event evt = [SELECT Id, Type FROM Event LIMIT 1];
List <Event> addEvt = new List<Event>();
evt.Type = 'Rdv Physique';
evt.Type_RDV__c = 'Rdv';
addEvt.add(evt);
update addEvt;
}