Skip to content

Instantly share code, notes, and snippets.

@lfreeland
Created March 18, 2018 22:31
Show Gist options
  • Select an option

  • Save lfreeland/0875323bd9f7566750121511418c33bd to your computer and use it in GitHub Desktop.

Select an option

Save lfreeland/0875323bd9f7566750121511418c33bd to your computer and use it in GitHub Desktop.
Lightning Record Video Viewer Component Apex Controller Test Class
@isTest
public with sharing class RecordVideoViewerControllerTest {
@isTest
static void getVideoURL_accountWithWebsiteAsVideoSource_expectVideoSourceUrlReturnedTest() {
String videoSrcURL = 'http://vid@example.com';
Account acct = new Account(
Name = 'Test Account',
Website = videoSrcURL
);
insert acct;
String recordVideoSrcUrl = RecordVideoViewerController.getVideoURL(acct.Id, 'Website');
system.assertEquals(videoSrcURL, recordVideoSrcUrl, 'The video url was not retrieved from the website field on the account.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment