Permalink
Browse files

added method having default setup data in test utility

  • Loading branch information...
1 parent 72ff4b5 commit e0843b39c0111f5fa975c021100a4688109e750c @persistentSFteam committed Apr 26, 2012
Showing with 52 additions and 1 deletion.
  1. +52 −1 src/classes/Milestone1_Test_Utility.cls
@@ -247,5 +247,56 @@ public with sharing class Milestone1_Test_Utility {
return tasksMap;
}
-
+ public static void createFilterData(){
+ Milestone1_Project__c testProject = Milestone1_Test_Utility.sampleProject('UNIT TEST PROJECT NAME ABC123XYZ UNIQUE' + System.now());
+ testProject.Status__c = 'Active';
+ testProject.Deadline__c = Date.today();
+ insert testProject;
+
+ Milestone1_Project__c testProject1 = Milestone1_Test_Utility.sampleProject('UNIT TEST PROJECT NAME ABC123XYZ UNIQUE' + System.now());
+ testProject1.Status__c = 'Active';
+ testProject1.Deadline__c = Date.today();
+ insert testProject1;
+
+ Milestone1_Project__c testProject2 = Milestone1_Test_Utility.sampleProject('UNIT TEST PROJECT NAME ABC123XYZ UNIQUE' + System.now());
+ testProject2.Status__c = 'Active';
+ testProject2.Deadline__c = Date.today();
+ insert testProject2;
+
+ Milestone1_Milestone__c testMilestone = Milestone1_Test_Utility.sampleMilestone(testProject.Id,null,'UNIT TEST MILESTONE NAME ACB123XYZ UNIQUE' + System.now());
+ testMilestone.Deadline__c = Date.today();
+ testMilestone.Complete__c = false;
+ insert testMilestone;
+
+ Milestone1_Milestone__c testMilestone1 = Milestone1_Test_Utility.sampleMilestone(testProject1.Id,null,'UNIT TEST MILESTONE NAME ACB123XYZ UNIQUE' + System.now());
+ testMilestone1.Deadline__c = Date.today();
+ testMilestone1.Complete__c = false;
+ insert testMilestone1;
+
+ Milestone1_Milestone__c testMilestone2 = Milestone1_Test_Utility.sampleMilestone(testProject2.Id,null,'UNIT TEST MILESTONE NAME ACB123XYZ UNIQUE' + System.now());
+ testMilestone2.Deadline__c = Date.today();
+ testMilestone2.Complete__c = false;
+ insert testMilestone2;
+
+ Milestone1_Task__c testTask = Milestone1_Test_Utility.sampleTask(testMilestone.Id);
+ testTask.Complete__c = false;
+ testTask.Start_Date__c = Date.today();
+ testTask.Due_Date__c = Date.today();
+ insert testTask;
+
+ Milestone1_Task__c testTask1 = Milestone1_Test_Utility.sampleTask(testMilestone1.Id);
+ testTask1.Complete__c = false;
+ testTask1.Start_Date__c = Date.today();
+ testTask1.Due_Date__c = Date.today();
+ insert testTask1;
+
+ Milestone1_Task__c testTask2 = Milestone1_Test_Utility.sampleTask(testMilestone2.Id);
+ testTask2.Complete__c = false;
+ testTask2.Start_Date__c = Date.today();
+ testTask2.Due_Date__c = Date.today();
+ insert testTask2;
+
+
+ }
+
}

0 comments on commit e0843b3

Please sign in to comment.