コード例 #1
0
        public void CreateTaskAssignment_ReturnsANewTaskAssignment()
        {
            _todelete = Api.CreateTaskAssignment(GetTestId(TestId.ProjectId), GetTestId(TestId.TaskId2));

            Assert.NotNull(_todelete);
            Assert.Equal(GetTestId(TestId.ProjectId), _todelete.ProjectId);
            Assert.Equal(GetTestId(TestId.TaskId2), _todelete.TaskId);
        }
コード例 #2
0
        public void CreateNewTaskAndAssign_ReturnsANewTaskAssignment()
        {
            _todelete = Api.CreateNewTaskAndAssign(GetTestId(TestId.ProjectId), "Create New Task And Assign Test");
            _todeletetask = Api.Task(_todelete.TaskId);

            Assert.NotNull(_todelete);
            Assert.Equal(GetTestId(TestId.ProjectId), _todelete.ProjectId);
            Assert.Equal("Create New Task And Assign Test", _todeletetask.Name);
        }
コード例 #3
0
        public void UpdateTaskAssignment_UpdatesOnlyChangedValues()
        {
            var projectId = GetTestId(TestId.ProjectId);

            _todelete = Api.CreateTaskAssignment(projectId, GetTestId(TestId.TaskId2));
            var updated = Api.UpdateTaskAssignment(projectId, _todelete.Id, billable: true, hourlyRate: 1);

            // stuff changed
            Assert.NotEqual(_todelete.Billable, updated.Billable);
            Assert.Equal(false, _todelete.Billable);
            Assert.NotEqual(_todelete.HourlyRate, updated.HourlyRate);
            Assert.Equal(0m, _todelete.HourlyRate);

            // stuff didn't change
            Assert.Equal(_todelete.Id, updated.Id);
            Assert.Equal(projectId, updated.ProjectId);
            Assert.Equal(_todelete.TaskId, updated.TaskId);
            Assert.Equal(null, updated.Budget);
            Assert.Equal(false, updated.Deactivated);
        }