CollaborationGroupFeed in Test Class in Salesforce

Sample Test Class:

@isTest
private class CollaborationGroupFeedTest {

    static testMethod void test() {
        CollaborationGroup cg = new CollaborationGroup(Name = 'Test', CollaborationType = 'Public');
        insert cg;
        FeedItem FI = new FeedItem(Body = 'Test', ParentId = cg.Id);
        insert FI;
        system.debug('Output is ' + [ SELECT Body, Type FROM CollaborationGroupFeed ]);
    }

}

Output:


Cheers!!!

No comments:

Post a Comment