Ejemplo n.º 1
0
        public void UpdateTeamTask()
        {
            var a             = this.CreateAccount();
            var team          = CreateSampleTeam();
            var creatorMember = AddSampleMemberToTeam(a, team);
            var member        = AddSampleMemberToTeam(team);
            var project       = AddSampleProjectToTeam(team);
            var task          = new TeamTask(creatorMember, team);

            task.AssignTo(member);
            task.AddToProject(project);
            this._taskService.Create(task);

            this.Evict(task);

            var task2   = this._taskService.GetTask(task.ID) as TeamTask;
            var member2 = AddSampleMemberToTeam(team);

            task2.AssignTo(member2);
            task2.RemoveFromProject(project);

            Assert.AreEqual(member2.ID, task2.AssigneeId.Value);
            Assert.AreEqual(0, task2.ProjectIds.Count());

            this._taskService.Update(task2);
            this.Evict(task2);
            var task3 = this._taskService.GetTask(task2.ID) as TeamTask;

            Assert.AreEqual(task2.Subject, task3.Subject);
            Assert.AreEqual(task2.Body, task3.Body);
            Assert.AreEqual(task2.Priority, task3.Priority);
            Assert.AreEqual(task2.DueTime, task3.DueTime);
            Assert.AreEqual(task2.IsCompleted, task3.IsCompleted);
            Assert.AreEqual(task2.CreatorMemberId, task3.CreatorMemberId);

            Assert.AreEqual(task2.TeamId, task3.TeamId);
            Assert.AreEqual(task2.AssigneeId.Value, task3.AssigneeId.Value);
            Assert.AreEqual(task2.ProjectIds.Count(), task3.ProjectIds.Count());

            this.Evict(task3);

            var task4 = this._taskService.GetTask(task3.ID) as TeamTask;

            task4.RemoveAssignee();

            Assert.AreEqual(null, task4.AssigneeId);

            this._taskService.Update(task4);
            this.Evict(task4);
            var task5 = this._taskService.GetTask(task4.ID) as TeamTask;

            Assert.AreEqual(task4.AssigneeId, task5.AssigneeId);
        }
Ejemplo n.º 2
0
        public void DeleteTeamTask()
        {
            var a       = this.CreateAccount();
            var team    = CreateSampleTeam();
            var member  = AddSampleMemberToTeam(team);
            var project = AddSampleProjectToTeam(team);
            var task    = new TeamTask(member, team);

            task.AssignTo(member);
            task.AddToProject(project);
            this._taskService.Create(task);

            this.Evict(task);

            var task2 = this._taskService.GetTask(task.ID) as TeamTask;

            _taskService.Delete(task2);

            this.Evict(task2);

            var task3 = this._taskService.GetTask(task2.ID) as TeamTask;

            Assert.IsNull(task3);
        }
Ejemplo n.º 3
0
        public void DeleteTeamTask()
        {
            var a = this.CreateAccount();
            var team = CreateSampleTeam();
            var member = AddSampleMemberToTeam(team);
            var project = AddSampleProjectToTeam(team);
            var task = new TeamTask(member, team);
            task.AssignTo(member);
            task.AddToProject(project);
            this._taskService.Create(task);

            this.Evict(task);

            var task2 = this._taskService.GetTask(task.ID) as TeamTask;

            _taskService.Delete(task2);

            this.Evict(task2);

            var task3 = this._taskService.GetTask(task2.ID) as TeamTask;

            Assert.IsNull(task3);
        }
Ejemplo n.º 4
0
        public void UpdateTeamTask()
        {
            var a = this.CreateAccount();
            var team = CreateSampleTeam();
            var creatorMember = AddSampleMemberToTeam(a, team);
            var member = AddSampleMemberToTeam(team);
            var project = AddSampleProjectToTeam(team);
            var task = new TeamTask(creatorMember, team);
            task.AssignTo(member);
            task.AddToProject(project);
            this._taskService.Create(task);

            this.Evict(task);

            var task2 = this._taskService.GetTask(task.ID) as TeamTask;
            var member2 = AddSampleMemberToTeam(team);

            task2.AssignTo(member2);
            task2.RemoveFromProject(project);

            Assert.AreEqual(member2.ID, task2.AssigneeId.Value);
            Assert.AreEqual(0, task2.ProjectIds.Count());

            this._taskService.Update(task2);
            this.Evict(task2);
            var task3 = this._taskService.GetTask(task2.ID) as TeamTask;

            Assert.AreEqual(task2.Subject, task3.Subject);
            Assert.AreEqual(task2.Body, task3.Body);
            Assert.AreEqual(task2.Priority, task3.Priority);
            Assert.AreEqual(task2.DueTime, task3.DueTime);
            Assert.AreEqual(task2.IsCompleted, task3.IsCompleted);
            Assert.AreEqual(task2.CreatorMemberId, task3.CreatorMemberId);

            Assert.AreEqual(task2.TeamId, task3.TeamId);
            Assert.AreEqual(task2.AssigneeId.Value, task3.AssigneeId.Value);
            Assert.AreEqual(task2.ProjectIds.Count(), task3.ProjectIds.Count());

            this.Evict(task3);

            var task4 = this._taskService.GetTask(task3.ID) as TeamTask;

            task4.RemoveAssignee();

            Assert.AreEqual(null, task4.AssigneeId);

            this._taskService.Update(task4);
            this.Evict(task4);
            var task5 = this._taskService.GetTask(task4.ID) as TeamTask;

            Assert.AreEqual(task4.AssigneeId, task5.AssigneeId);
        }