function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Akhil Katkam 5Akhil Katkam 5 

Test class for this code

Hi Developer Community , 

can u please write test class for this apex code
public class RSSObject {
    @AuraEnabled
    public String title {get;set;}
    @AuraEnabled
    public String link {get;set;}
    @AuraEnabled
    public String content {get;set;}
    @AuraEnabled
    public String published {get;set;}
    
    public RSSObject(String title, String link, String content, String published) {
        this.title = title;
        this.link = link;
        this.content = content;
        this.published = published;
    }
}

Thanks in Advance
Best Answer chosen by Akhil Katkam 5
Suraj Tripathi 47Suraj Tripathi 47
Hi Akhil,
You can take reference from this below code.
@isTest
Public class RSSObject_Test{
  @isTest static void method(){
      test.startTest();
       RSSObject rss= new RSSObject('Test','https://www.google.com/','http://www.africau.edu/images/default/sample.pdf','/services/data/v45.0/sobjects/Cloud_News__e');
       test.stoptest();
   }
}
In case you find any other issue please mention. 
If you find your Solution then mark this as the best answer. 

 

All Answers

Suraj Tripathi 47Suraj Tripathi 47
Hi Akhil,
You can take reference from this below code.
@isTest
Public class RSSObject_Test{
  @isTest static void method(){
      test.startTest();
       RSSObject rss= new RSSObject('Test','https://www.google.com/','http://www.africau.edu/images/default/sample.pdf','/services/data/v45.0/sobjects/Cloud_News__e');
       test.stoptest();
   }
}
In case you find any other issue please mention. 
If you find your Solution then mark this as the best answer. 

 
This was selected as the best answer
Akhil Katkam 5Akhil Katkam 5
Thanks Suraj