You need to sign in to do that
Don't have an account?
Koustubh Kulkarni
Need help to write test class?
Hi I am new to salesforce. i need help for writting a test class for the following controller.Can anyone help me with it.
public class my_groups
{
Set<Id> setGroupMemberId = new Set<Id>();
public cntrl_my_groups()
{
List<CollaborationGroup> lstGroup = new List<CollaborationGroup>();
Id currentUserId = UserInfo.getUserId();
List<CollaborationGroupMember> lstGroupMember = [SELECT CollaborationGroupId,MemberId FROM CollaborationGroupMember where MemberId =:currentUserId];
for(CollaborationGroupMember gm : lstGroupMember)
{
setGroupMemberId.add(gm.CollaborationGroupId);
}
}
public list<CollaborationGroup> get_my_group
{
get
{
if(setGroupMemberId.size() > 0)
get_my_group = [SELECT Id,Name FROM CollaborationGroup where Id in: setGroupMemberId];
return get_my_group;
}
set;
}
}
Any kind of help will be Appreciated.Thanks
public class my_groups
{
Set<Id> setGroupMemberId = new Set<Id>();
public cntrl_my_groups()
{
List<CollaborationGroup> lstGroup = new List<CollaborationGroup>();
Id currentUserId = UserInfo.getUserId();
List<CollaborationGroupMember> lstGroupMember = [SELECT CollaborationGroupId,MemberId FROM CollaborationGroupMember where MemberId =:currentUserId];
for(CollaborationGroupMember gm : lstGroupMember)
{
setGroupMemberId.add(gm.CollaborationGroupId);
}
}
public list<CollaborationGroup> get_my_group
{
get
{
if(setGroupMemberId.size() > 0)
get_my_group = [SELECT Id,Name FROM CollaborationGroup where Id in: setGroupMemberId];
return get_my_group;
}
set;
}
}
Any kind of help will be Appreciated.Thanks
Please find your required test class below :
Please fill all the required fields if any error appears for Required fields missing.
Let me know if there is any other issue.
Thanks,
Abhishek
All Answers
Please find your required test class below :
Please fill all the required fields if any error appears for Required fields missing.
Let me know if there is any other issue.
Thanks,
Abhishek
Thanks
Koustubh