public async Task GetJobDetails_ReturnsJobViewModel() { IJobsApiClient jobsApiClient = Substitute.For <IJobsApiClient>(); JobManagementResiliencePolicies policies = new JobManagementResiliencePolicies { JobsApiClient = Policy.NoOpAsync() }; IMessengerService messengerService = Substitute.For <IMessengerService>(); ILogger logger = Substitute.For <ILogger>(); JobViewModel jvm = new JobViewModel { CompletionStatus = null }; ApiResponse <JobViewModel> jobApiResponse = new ApiResponse <JobViewModel>(HttpStatusCode.OK, jvm); jobsApiClient .GetJobById(Arg.Any <string>()) .Returns(jobApiResponse); JobManagement jobManagement = new JobManagement(jobsApiClient, logger, policies, messengerService); string jobId = "3456"; //Act JobViewModel viewModel = await jobManagement.GetJobById(jobId); //Assert viewModel .Should() .Be(jvm); }