public async Task <SupplierAttribute> BuildAsync() { var headers = await _defaultRequestHeadersService.GetAsync(); var id = await _customerAttributesClient.CreateAsync(_attribute, headers); return(await _customerAttributesClient.GetAsync(id, headers)); }
public async Task WhenCreate_ThenSuccess() { var headers = await _defaultRequestHeadersService.GetAsync(); var attribute = new SupplierAttribute { Id = Guid.NewGuid(), Type = AttributeType.Text, Key = "Test".WithGuid(), IsDeleted = false }; var createdAttributeId = await _supplierAttributesClient.CreateAsync(attribute, headers); var createdAttribute = await _supplierAttributesClient.GetAsync(createdAttributeId, headers); Assert.NotNull(createdAttribute); Assert.Equal(createdAttributeId, createdAttribute.Id); Assert.Equal(attribute.Type, createdAttribute.Type); Assert.Equal(attribute.Key, createdAttribute.Key); Assert.Equal(attribute.IsDeleted, createdAttribute.IsDeleted); Assert.True(createdAttribute.CreateDateTime.IsMoreThanMinValue()); }