I have a method in the controller
public PageReference add() {
insert technology;
return null;
}
technology
is a custom object .It has its own getters and setters.How do I test this method
public static testMethod void testMyController() {
PageReference pageRef = Page.yourPageName;
Test.setCurrentPage(pageRef);
MyController controller = new MyController();
controller.add();
}