public async void GetResultConfigsForMetadata_ValidMetadataId_ReturnsReultConfigModelList() { // Arrange var metadataId = "4439722e-a6d0-4f7a-9d33-0cc5a2a66da0"; var httpService = new HttpService(new HttpClient()); var resultConfigClient = new ResultConfigClient( httpService ); // Act var result = await resultConfigClient.GetResultConfigsForMetadata(metadataId); // Assert Assert.NotEmpty(result); }
public async void GetMetadataForProject_OkStatusCode_ReturnsMarkSessionModelList() { // Arrange var httpResponseMessage = new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(ResultConfigModelDataMocks.MockResultConfigResponseModelListJson) }; var httpService = new Mock <IHttpService>(); httpService .Setup(m => m.GetAsync(It.IsAny <string>())) .ReturnsAsync(httpResponseMessage); var resultConfigClient = new ResultConfigClient(httpService.Object); // Act var result = await resultConfigClient.GetResultConfigsForMetadata(It.IsAny <string>()); // Assert Assert.NotEmpty(result); }
public async void GetMetadataForProject_NotFoundStatusCode_ReturnsEmptyList() { // Arrange var httpResponseMessage = new HttpResponseMessage { StatusCode = HttpStatusCode.NotFound, Content = new StringContent("") }; var httpService = new Mock <IHttpService>(); httpService .Setup(m => m.GetAsync(It.IsAny <string>())) .ReturnsAsync(httpResponseMessage); var resultConfigClient = new ResultConfigClient(httpService.Object); // Act var result = await resultConfigClient.GetResultConfigsForMetadata(It.IsAny <string>()); // Assert Assert.Empty(result); }