I am new to salesforce and i am writing a test class for the trigger. Can any one tell me how to write a test class for the trigger below
trigger CloseParentCommunication on BuyerSellerCommunication__c (before insert,after insert,before update,after update) {
List<ID> parentCommId = New List<ID>();
for(seit__BuyerSellerCommunication__c communication:Trigger.new)
{
if(communication.seit__Status__c=='Closed' && communication.seit__Parent_Communication__c!=Null)
{
parentCommId.add(communication.seit__Parent_Communication__c);
}
}
List<seit__BuyerSellerCommunication__c> parentCommList = [SELECT id,name,status__c FROM seit__BuyerSellerCommunication__c WHERE id in :parentCommId];
for(integer i = 0 ; i < parentCommList .size(); i++){
parentCommList[i].status__c = 'Closed';
update parentCommList[i];
}
update parentCommList;
}