Пример #1
0
        public async Task CreateOperationDetails()
        {
            string url = ApiPaths.OPERATIONS_DETAILS_CREATE_PATH;
            OperationDetailsDTO createDTO = new OperationDetailsDTO()
            {
                TransactionId = this.TestOperationCreateDetails.Id,
                Comment       = Guid.NewGuid().ToString() + GlobalConstants.AutoTest
            };
            string createParam = JsonUtils.SerializeObject(createDTO);

            var response = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, createParam, Method.POST);

            Assert.True(response.Status == HttpStatusCode.OK);

            OperationDetailsEntity entity = await this.OperationDetailsRepository.TryGetAsync(
                d => d.PartitionKey == this.TestClientId && d.TransactionId == this.TestOperationCreateDetails.Id) as OperationDetailsEntity;

            Assert.NotNull(entity);

            Assert.True(entity.Comment == createDTO.Comment);
        }
Пример #2
0
        public async Task RegisterOperationDetails()
        {
            string url = ApiPaths.OPERATIONS_DETAILS_REGISTER_PATH;
            OperationDetailsDTO createDTO = new OperationDetailsDTO()
            {
                TransactionId = this.TestOperationRegisterDetails.Id,
                Comment       = Guid.NewGuid().ToString() + GlobalConstants.AutoTest
            };
            string createParam = JsonUtils.SerializeObject(createDTO);

            var response = await this.Consumer.ExecuteRequest(url, Helpers.EmptyDictionary, createParam, Method.POST);

            Assert.True(response.Status == HttpStatusCode.OK);

            OperationDetailsReturnDTO parsedResponse = JsonUtils.DeserializeJson <OperationDetailsReturnDTO>(response.ResponseJson);

            OperationDetailsEntity entity = await this.OperationDetailsRepository.TryGetAsync(this.TestClientId, parsedResponse.Id) as OperationDetailsEntity;

            Assert.NotNull(entity);

            Assert.True(entity.TransactionId == createDTO.TransactionId);
            Assert.True(entity.Comment == createDTO.Comment);
        }