public async Task Should_return_null_if_permission_not_allowed() { RouteHandlers.ListDirectorsHandler = () => GetDirectorsRoute.Handle(() => Enumerable.Empty <Director>(), () => false); var res = await client.GetAsync("/functional/directors"); Assert.Equal(HttpStatusCode.Unauthorized, res.StatusCode); }
public async Task Should_return_list_of_director_data() { RouteHandlers.ListDirectorsHandler = () => GetDirectorsRoute.Handle(() => new[] { new Director { Name = "Ridley Scott" } }, () => true); var res = await client.GetAsync("/functional/directors"); Assert.Equal(HttpStatusCode.OK, res.StatusCode); Assert.True((await res.Content.ReadAsStringAsync()).Contains("Ridley")); }