예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }