public async Task GetUsers_ValidBearer_InvalidFilter_ShouldReturnAllUsers() { var bearer = await FixtureHelpers.GetFixtureContentsAsync("token.txt");//Todo: this can be replaced with getting token from auth0 var request = new HttpRequestMessage(HttpMethod.Get, "users?filter=test"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", bearer); var response = await httpClient.SendAsync(request); var jsonContent = await response.Content.ReadAsStringAsync(); response.StatusCode.ShouldEqual(HttpStatusCode.OK); var users = JsonConvert.DeserializeObject <IEnumerable <UserModel> >(jsonContent); users.ShouldNotBeEmpty(); users.Count().ShouldBeGreaterThan(6); }
public async Task GetUsers_ValidBearer_SearchByEmailAndNickName_ShouldReturnTwo() { var bearer = await FixtureHelpers.GetFixtureContentsAsync("token.txt");//Todo: this can be replaced with getting token from auth0 var request = new HttpRequestMessage(HttpMethod.Get, "[email protected]&nickname=rainbow"); request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", bearer); var response = await httpClient.SendAsync(request); var jsonContent = await response.Content.ReadAsStringAsync(); response.StatusCode.ShouldEqual(HttpStatusCode.OK); var users = JsonConvert.DeserializeObject <IEnumerable <UserModel> >(jsonContent); users.ShouldNotBeEmpty(); users.Count().ShouldEqual(2); }