i was trying to write unit test cases using XCTest for SLComposeViewController and couldn't find any solution so far.Any suggestion in terms of approach and code would be helpful.
My objective is to test the below code using XCTest
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeTwitter];
SLComposeViewControllerCompletionHandler __block completionHandler = ^(SLComposeViewControllerResult result)
{
[tweetSheet dismissViewControllerAnimated:YES completion:nil];
switch(result)
{
case SLComposeViewControllerResultCancelled:
{
[self showAlertWithTitle:nil
andMsg:NSLocalizedString(@"Sharing failed", @"Workout summary text")];
}
break;
case SLComposeViewControllerResultDone:
{
[self showAlertWithTitle:NSLocalizedString(@"Success", @"Success")
andMsg:NSLocalizedString(@"Message shared", @"Workout summary share text")];
}
break;
}
};