You need to sign in to do that
Don't have an account?
Nathaniel Neblett 18
Help with Test Class for Custom Controller used in visualforce page
Hey. I'm looking for some help with writing a test class for a custom controller that I am using in a VF page. The class code is below. The visualforce page is very light weight as it simply references the content in the static resources using the method in the controller. Everything works like a dream but I am struggling with creating the test class for the the controller. Please help me write the test class as I am looking to deploy to a production org but cannot because the code coverage for the class is 0%
Thanks
public class RelNotesStaticResCtrl {
public String textFromWinter20ReleaseNotesSummary
{
get {
StaticResource sr1 = [
select Body
from StaticResource
where Name = 'Winter20ReleaseNotesSummary'
];
return sr1.Body.toString();
}
}
public String textFromCurrentReleaseNotesHTML
{
get {
StaticResource sr2 = [
select Body
from StaticResource
where Name = 'CurrentReleaseNotesHTML'
];
return sr2.Body.toString();
}
}
}
Thanks
public class RelNotesStaticResCtrl {
public String textFromWinter20ReleaseNotesSummary
{
get {
StaticResource sr1 = [
select Body
from StaticResource
where Name = 'Winter20ReleaseNotesSummary'
];
return sr1.Body.toString();
}
}
public String textFromCurrentReleaseNotesHTML
{
get {
StaticResource sr2 = [
select Body
from StaticResource
where Name = 'CurrentReleaseNotesHTML'
];
return sr2.Body.toString();
}
}
}
All Answers