How can I create Group with certain name and add group members to that group for Test classes?
As I am using 'ABC' developer name group in my class, So now I am writing test class to cover those lines.
But When I try to insert the test group in my test class, I am getting this error. [System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_DEVELOPER_NAME, This Developer Name already exists or has been previously used. Please choose a different name.: [DeveloperName] ]
Group testGroup = new Group();
testGroup.Name = 'testGroup';
testGroup.DeveloperName = 'ABC';
INSERT testGroup;
Due to my understanding, DML in test classes are just creating during test. And I didn't set seeAllData=true in my test class too. So should be separated with real data?
Can someone share me their knowledge?