Ejemplo n.º 1
0
        public void TestAdditionalUsersCanDoWorkOnTicketsForCurrentIteration()
        {
            var role = new Role(new[] { Permission.AssignSprint });
            var user = new User(role);

            user.Login();
            var httpContext     = new HttpContext();
            var planningService = new PlanningService(httpContext);
            var sprint          = planningService.CreateSprint(10);

            sprint.Start();
            var ticket1 = planningService.NewTicket();

            ticket1.AddPlannedEffort(3);
            planningService.AssignToCurrentIteration(user, ticket1);
            var ticket2 = planningService.NewTicket();

            ticket2.AddPlannedEffort(3);
            planningService.AssignToCurrentIteration(user, ticket2);
            var ticket3 = planningService.NewTicket();

            ticket3.AddPlannedEffort(5);
            planningService.AssignToCurrentIteration(user, ticket3);

            var team1 = new User(role);
            var team2 = new User(role);
            var team3 = new User(role);

            planningService.UpdateTicketWithUser(ticket1, team1);
            planningService.UpdateTicketWithUser(ticket1, team2);
            planningService.UpdateTicketWithUser(ticket1, team3);

            var ticketWithTeam = planningService.GetTaskById(ticket1.TicketId);

            Assert.That(ticketWithTeam.Users.Count, Is.EqualTo(3));
        }