public async Task TryQueueJobs_Called_ReturnsJobCreateResults() { IJobsApiClient jobsApiClient = Substitute.For <IJobsApiClient>(); JobManagementResiliencePolicies policies = new JobManagementResiliencePolicies { JobsApiClient = Policy.NoOpAsync() }; IMessengerService messengerService = Substitute.For <IMessengerService>(); ILogger logger = Substitute.For <ILogger>(); JobCreateModel createModelOne = new JobCreateModel(); JobCreateModel createModelTwo = new JobCreateModel(); JobCreateResult expectedCreateResultOne = new JobCreateResult(); JobCreateResult expectedCreateResultTwo = new JobCreateResult(); IEnumerable <JobCreateModel> createModels = new [] { createModelOne, createModelTwo }; jobsApiClient .TryCreateJobs(Arg.Is <IEnumerable <JobCreateModel> >(_ => _.SequenceEqual(createModels))) .Returns(new ApiResponse <IEnumerable <JobCreateResult> >(HttpStatusCode.OK, new[] { expectedCreateResultOne, expectedCreateResultTwo })); JobManagement jobManagement = new JobManagement(jobsApiClient, logger, policies, messengerService); //Act IEnumerable <JobCreateResult> actualResult = await jobManagement.TryQueueJobs(createModels); actualResult .Should() .BeEquivalentTo <JobCreateResult>(new [] { expectedCreateResultOne, expectedCreateResultTwo }); }