Exemple #1
0
        public async Task <CrmTaskStatus> BuildAsync()
        {
            var headers = await _defaultRequestHeadersService.GetAsync();

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

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

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

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

            var createdStatus = await _taskStatusesClient.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());
        }