I have written plenty of unit tests for Triggers. But I am kind of stuck on how to write one out for a simple view controller.
Here is the custom controller for my VF Controller:
public with sharing class NotificationListController {
private final Account account;
public List<Account_Notification__c> notifications {get;set;}
date d = system.today();
public NotificationListController(){
account = [SELECT Id FROM Account
WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
notifications = [SELECT Account__c, Related_Product__c, Description__c, Type__c, Expiration_Date__c, Active__c
FROM Account_Notification__c
WHERE Account__c = :account.Id
AND Active__c = true AND (Expiration_Date__c = null OR Expiration_Date__c > :d) ];
}
}
What needs to be asserted? Do I just create account notifications and check for their existence?
Thanks y'all.