public async Task IgnoresNonGuidArguments(int getGroupExceptions, int getMembersExceptions) { const int userCount = 2500213; Guid[] sourceGroups = Enumerable.Range(0, 5).Select(_ => Guid.NewGuid()).ToArray(); Guid destinationGroup = Guid.NewGuid(); var mockGroups = new Dictionary <Guid, List <AzureADUser> >(); for (int i = 0; i < userCount; i++) { var currentGroup = sourceGroups[i % sourceGroups.Length]; var userToAdd = new AzureADUser { ObjectId = Guid.NewGuid() }; if (mockGroups.TryGetValue(currentGroup, out var users)) { users.Add(userToAdd); } else { mockGroups.Add(currentGroup, new List <AzureADUser> { userToAdd }); } } var graphRepo = new MockGraphGroupRepository() { GroupsToUsers = mockGroups, ThrowSocketExceptionsFromGroupExistsBeforeSuccess = getGroupExceptions, ThrowSocketExceptionsFromGetUsersInGroupBeforeSuccess = getMembersExceptions }; var serviceBus = new MockMembershipServiceBusRepository(); var mail = new MockMailRepository(); var mailAddresses = new MockEmail <IEmailSenderRecipient>(); var syncJobs = new MockSyncJobRepository(); var dryRun = new MockDryRunValue() { DryRunEnabled = false }; var calc = new SGMembershipCalculator(graphRepo, serviceBus, mail, mailAddresses, syncJobs, new MockLoggingRepository(), dryRun); var testJob = new SyncJob { RowKey = "row", PartitionKey = "partition", TargetOfficeGroupId = destinationGroup, Query = string.Join(';', sourceGroups) + ";nasdfasfd;;;", Status = "InProgress" }; syncJobs.ExistingSyncJobs.Add((testJob.RowKey, testJob.PartitionKey), testJob); var groups = calc.ReadSourceGroups(testJob); foreach (var group in groups) { await calc.SendEmailAsync(testJob, Guid.NewGuid(), "Content", null); } Assert.IsNull(serviceBus.Sent); }