Skip to content

Commit

Permalink
Added unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
keirbowden committed Sep 28, 2016
1 parent 3741ac0 commit dd00957
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 3 deletions.
17 changes: 17 additions & 0 deletions src/classes/ChatterReporterController.cls
@@ -1,3 +1,20 @@
/*******************************************************************************
* ChatterReporterController
*
* Description:
*
* Custom controller for the Jasmine Chatter Reporter - posts the results of
* a test run to chatter, along with a link to find out more details.
*
* If you are the sort of person who enjoys reading code, you may be interested
* in a career with BrightGen - check out http://www.brightgen.com or
* email recruitment@brightgen.com
*
* Author Keir Bowden
* Date Aug 2016
*
* Changes:
********************************************************************************/
public class ChatterReporterController {
@AuraEnabled
public static void PostResultsToChatter(String message, String link)
Expand Down
25 changes: 25 additions & 0 deletions src/classes/ChatterReporterController_Test.cls
@@ -0,0 +1,25 @@
/** *****************************************************************************
* ChatterReporterController_Test
*
* Description:
*
* Test class for the ChatterReporterController
*
* If you are the sort of person who enjoys reading code, you may be interested
* in a career with BrightGen - check out http://www.brightgen.com or
* email recruitment@brightgen.com
*
* Author Keir Bowden
* Date Aug 2016
*
* Changes:
********************************************************************************/
@isTest
private class ChatterReporterController_Test
{
@isTest
static void TestController()
{
ChatterReporterController.PostResultsToChatter('Unit Test', 'http://www.brightgen.com');
}
}
5 changes: 5 additions & 0 deletions src/classes/ChatterReporterController_Test.cls-meta.xml
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>37.0</apiVersion>
<status>Active</status>
</ApexClass>
16 changes: 16 additions & 0 deletions src/classes/JobWrapper.cls
@@ -1,3 +1,19 @@
/*******************************************************************************
* JobWrapper
*
* Description:
*
* Wrapper class for a job, the skills and any applications
*
* If you are the sort of person who enjoys reading code, you may be interested
* in a career with BrightGen - check out http://www.brightgen.com or
* email recruitment@brightgen.com
*
* Author Keir Bowden
* Date Aug 2016
*
* Changes:
********************************************************************************/
public class JobWrapper
{
@AuraEnabled
Expand Down
21 changes: 18 additions & 3 deletions src/classes/JobsController.cls
@@ -1,7 +1,22 @@
public class JobsController
/*******************************************************************************
* JobsController
*
* Description:
*
* Custom controller for the Jobs demo application created for the Dreamforce
* 16 talk on Unit Testing Lightning Components with Jasmine
*
* If you are the sort of person who enjoys reading code, you may be interested
* in a career with BrightGen - check out http://www.brightgen.com or
* email recruitment@brightgen.com
*
* Author Keir Bowden
* Date Aug 2016
*
* Changes:
********************************************************************************/
public class JobsController
{
public List<JobWrapper> jobWrappers {get; set;}

@AuraEnabled
public static List<JobWrapper> GetRecentJobs()
{
Expand Down
28 changes: 28 additions & 0 deletions src/classes/JobsController_Test.cls
@@ -0,0 +1,28 @@
/** *****************************************************************************
* JobsController_Test
*
* Description:
*
* Test class for the JobsController
*
* If you are the sort of person who enjoys reading code, you may be interested
* in a career with BrightGen - check out http://www.brightgen.com or
* email recruitment@brightgen.com
*
* Author Keir Bowden
* Date Aug 2016
*
* Changes:
********************************************************************************/
@isTest
private class JobsController_Test
{
@isTest
static void TestController()
{
JobsSetup.SetupData();
JobsController.GetRecentJobs();
List<Skill__c> skills=JobsController.GetSkills();
JobsController.SearchJobs('test', 'test');
}
}
5 changes: 5 additions & 0 deletions src/classes/JobsController_Test.cls-meta.xml
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>37.0</apiVersion>
<status>Active</status>
</ApexClass>
16 changes: 16 additions & 0 deletions src/classes/JobsSetup.cls
@@ -1,3 +1,19 @@
/*******************************************************************************
* JobsSetup
*
* Description:
*
* Helper class to setup some data to try out the package
*
* If you are the sort of person who enjoys reading code, you may be interested
* in a career with BrightGen - check out http://www.brightgen.com or
* email recruitment@brightgen.com
*
* Author Keir Bowden
* Date Aug 2016
*
* Changes:
********************************************************************************/
public class JobsSetup {
public static void SetupData()
{
Expand Down

0 comments on commit dd00957

Please sign in to comment.