public async Task ThenAllRegisteredProvidersAreReturned() { if (!_context.TryGetValue <HttpResponseMessage>(ContextKeys.HttpResponse, out var result)) { Assert.Fail($"scenario context does not contain value for key [{ContextKeys.HttpResponse}]"); } var model = await HttpUtilities.ReadContent <GetProvidersResponse>(result.Content); var registeredProviders = DbUtilities.GetAllProviderRegistrations() .Join(DbUtilities.GetAllProviders(), provider => provider.Ukprn, registration => registration.Ukprn, (provider, registration) => { provider.Provider = registration; return(provider); }).AsQueryable() .FilterRegisteredProviders().ToList(); model.Providers.Should().BeEquivalentTo(registeredProviders, options => options .ExcludingMissingMembers() ); }