public async Task ResourceDiscoveryGroup_SuccessfulCall_ReturnsVersionHeader() { // Arrange var resourceDiscoveryClient = new ResourceDiscoveryClient(Configuration, Logger); // Act var response = await resourceDiscoveryClient.GetResourceDiscoveryGroupsWithResponseAsync(); // Assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.True(response.Headers.Contains(HttpHeaders.AgentVersion)); Assert.Equal(ExpectedVersion, response.Headers.GetFirstOrDefaultHeaderValue(HttpHeaders.AgentVersion)); }
public async Task ResourceDiscoveryGroup_GetAll_ReturnsValidList() { // Arrange var resourceDiscoveryClient = new ResourceDiscoveryClient(Configuration, Logger); // Act var response = await resourceDiscoveryClient.GetResourceDiscoveryGroupsWithResponseAsync(); // Assert Assert.Equal(HttpStatusCode.OK, response.StatusCode); var rawResponseBody = await response.Content.ReadAsStringAsync(); Assert.NotEmpty(rawResponseBody); var resourceDiscoveryGroups = JsonConvert.DeserializeObject <List <ResourceDiscoveryGroup> >(rawResponseBody); Assert.NotNull(resourceDiscoveryGroups); Assert.NotEmpty(resourceDiscoveryGroups); }