Esempio n. 1
0
        public async Task <ProductStatus> BuildAsync()
        {
            var headers = await _defaultRequestHeadersService.GetAsync();

            var id = await _productStatusesClient.CreateAsync(_status, headers);

            return(await _productStatusesClient.GetAsync(id, headers));
        }
        public async Task WhenCreate_ThenSuccess()
        {
            var headers = await _defaultRequestHeadersService.GetAsync();

            var status = new ProductStatus
            {
                Id        = Guid.NewGuid(),
                Name      = "Test".WithGuid(),
                IsDeleted = false
            };

            var createdStatusId = await _productStatusesClient.CreateAsync(status, headers);

            var createdStatus = await _productStatusesClient.GetAsync(createdStatusId, headers);

            Assert.NotNull(createdStatus);
            Assert.Equal(createdStatusId, createdStatus.Id);
            Assert.Equal(status.Name, createdStatus.Name);
            Assert.Equal(status.IsDeleted, createdStatus.IsDeleted);
            Assert.True(createdStatus.CreateDateTime.IsMoreThanMinValue());
        }