Пример #1
0
        public async void CreateDependantResultConfigResource_ValidResultConfigModel_ReturnsDependantResourceModel()
        {
            // Arrange
            var httpResponseMessage = new HttpResponseMessage
            {
                StatusCode = HttpStatusCode.OK,
                Content    = new StringContent(MetadataModelDataMocks.MockFinishedMetadataModelJson)
            };
            var httpService = new Mock <IHttpService>();

            httpService
            .Setup(m => m.GetAsync(It.IsAny <string>()))
            .ReturnsAsync(httpResponseMessage);
            httpService
            .Setup(m => m.PutAsync(It.IsAny <string>(), It.IsAny <string>()))
            .ReturnsAsync(httpResponseMessage);
            var resultConfigClient = new ResultConfigClient(httpService.Object);

            // Act
            var result = await resultConfigClient.CreateDependantResultConfigResource(
                ResultConfigModelDataMocks.MockResultConfigModel()
                );

            // Assert
            Assert.NotNull(result);
        }
Пример #2
0
        public async void CreateDependantResultConfigResource_ValidResultConfigId_ReturnsDependantResourceModel()
        {
            // Arrange
            var resultConfigId     = "2462a6b6-5e07-48b4-b3e3-b3b207d55f4e";
            var httpService        = new HttpService(new HttpClient());
            var resultConfigClient = new ResultConfigClient(
                httpService
                );

            // Act
            var result = await resultConfigClient.CreateDependantResultConfigResource(resultConfigId);

            // Assert
            Assert.NotNull(result);
        }