Esempio n. 1
0
        public async System.Threading.Tasks.Task WhenGetByIdAsync_IfExistPublishedTaskWithRightId_ThenIsReturned()
        {
            // ARRANGE
            var taskModel = new TaskModel()
            {
                Id   = Guid.NewGuid(),
                Name = Guid.NewGuid().ToString()
            };
            await _client.AddAsync(_publishedProject, taskModel);

            // ACT
            var result = await _client.GetByIdAsync(_publishedProject, taskModel.Id);

            // ASSERT
            Assert.Equal(taskModel.Id, result.Id);
        }
        private Task <PublishedTask> CreateTestTask()
        {
            var taskModel = new TaskModel()
            {
                Id             = Guid.NewGuid(),
                Name           = Guid.NewGuid().ToString(),
                Start          = DateTime.Today.AddDays(1).Date,
                Finish         = DateTime.Today.AddDays(4).Date,
                IsManual       = false,
                Priority       = 500,
                Work           = "0h",
                ConstraintType = ConstraintType.AsLateAsPossible
            };

            return(_taskClient.AddAsync(_publishedProject, taskModel));
        }