Inheritance: ModelBase, ILogable
Example #1
0
 public void TestVerwijderTaskZonderGeboekteUren()
 {
     task = Creation.Task();
     taskRepository.Delete(task);
     //UnitOfWork.CurrentSession.Clear();
     Task newTask = taskRepository.Get(task.Id);
     Assert.IsNull(newTask);
 }
Example #2
0
        public override void SetUp()
        {
            project = new Project();
            sprint = new Sprint();
            project.VoegSprintToe(sprint);
            story = new Story(project, new Gebruiker(), null, StoryType.UserStory);
            task = new Task();
            task2 = new Task();

            base.SetUp();
        }
Example #3
0
        public void TestVerwijderTaskMetGeboekteUrenGeeftJelloScrumRepositoryException()
        {
            TimeSpan ts = new TimeSpan(25, 30, 0);

            task = Creation.TaskMetStoryAndProjectAndGebruiker();
            task.MaakTijdRegistratie(task.Story.AangemaaktDoor, DateTime.Now, Creation.Sprint(task.Story.Project), new TimeSpan(8, 0, 0));
            taskRepository.Save(task);
               // UnitOfWork.CurrentSession.Clear();
            taskRepository.Delete(task);
            Assert.Fail();
        }
        public void TestBerekenTotaalBestedeTijdAanSprintStories()
        {
            task3 = new Task(story2);

            task.MaakTijdRegistratie(new Gebruiker(), DateTime.Now, sprint, new TimeSpan(1, 15, 10));
            task2.MaakTijdRegistratie(new Gebruiker(), DateTime.Now, sprint, new TimeSpan(1, 20, 10));
            task3.MaakTijdRegistratie(new Gebruiker(), DateTime.Now, sprint, new TimeSpan(1, 25, 10));

            sprint.MaakSprintStoryVoor(story);
            sprint.MaakSprintStoryVoor(story2);

            Assert.AreEqual(new TimeSpan(4, 0, 30), sprint.TotaalBestedeTijd());
        }
        public void TestBerekenTotaalBestedeTijdAanSprintStories()
        {
            task3 = new Task(story2);

            task.RegisterTime(new User(), DateTime.Now, sprint, new TimeSpan(1, 15, 10));
            task2.RegisterTime(new User(), DateTime.Now, sprint, new TimeSpan(1, 20, 10));
            task3.RegisterTime(new User(), DateTime.Now, sprint, new TimeSpan(1, 25, 10));

            sprint.CreateSprintStoryFor(story);
            sprint.CreateSprintStoryFor(story2);

            Assert.AreEqual(new TimeSpan(4, 0, 30), sprint.TotalTimeSpent());
        }
        public override void SetUp()
        {
            project = new Project();
            sprint = new Sprint();
            project.AddSprint(sprint);
            story = new Story(project, new User(), null, StoryType.UserStory);
            story2 = new Story(project, new User(), null, StoryType.UserStory);
            sprintStory = new SprintStory();
            task = new Task(story);
            task2 = new Task(story2);

            base.SetUp();
        }
        public override void SetUp()
        {
            project = new Project();

            task = new Task();
            gebruiker = new User();
            sprint = new Sprint();
            project.AddSprint(sprint);
            tijd = new TimeSpan(1, 30, 00); //1,5 uur

            story = new Story(project, gebruiker, null, StoryType.UserStory);
            story.AddTask(task);

            base.SetUp();
        }
Example #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TijdRegistratie"/> class.
        /// </summary>
        /// <param name="gebruiker">The gebruiker.</param>
        /// <param name="datum">The datum.</param>
        /// <param name="sprint">The sprint.</param>
        /// <param name="task">The task.</param>
        /// <param name="tijd">The tijd.</param>
        public TijdRegistratie(Gebruiker gebruiker, DateTime datum, Sprint sprint, Task task, TimeSpan tijd)
        {
            if (tijd.TotalMilliseconds == 0)
                throw new ArgumentOutOfRangeException("tijd", "Een tijdregistratie moet wel tijd bevatten.");
            if (gebruiker == null)
                throw new ArgumentNullException("gebruiker", "De gebruiker is null.");
            if (sprint== null)
                throw new ArgumentNullException("sprint", "De sprint is null.");
            if (task == null)
                throw new ArgumentNullException("task", "De task is null.");

            this.gebruiker = gebruiker;
            this.sprint = sprint;
            this.task = task;

            this.datum = datum;
            this.tijd = tijd;
        }
Example #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TimeRegistration"/> class.
        /// </summary>
        /// <param name="user">The user.</param>
        /// <param name="date">The date.</param>
        /// <param name="sprint">The sprint.</param>
        /// <param name="task">The task.</param>
        /// <param name="time">The time.</param>
        public TimeRegistration(User user, DateTime date, Sprint sprint, Task task, TimeSpan time)
        {
            if (time.TotalMilliseconds == 0)
                throw new ArgumentOutOfRangeException("time", "A timeregistration should contain time.");
            if (user == null)
                throw new ArgumentNullException("user", "The user can not be null.");
            if (sprint== null)
                throw new ArgumentNullException("sprint", "The sprint can not be null.");
            if (task == null)
                throw new ArgumentNullException("task", "The task can not be null.");

            this.user = user;
            this.sprint = sprint;
            this.task = task;

            this.date = date;
            this.time = time;
        }
Example #10
0
        /// <summary>
        /// Take over the given task from its current assigned user
        /// </summary>
        /// <param name="task">The task.</param>
        public virtual void TakeOverTask(Task task)
        {
            if (task == null)
                throw new ArgumentNullException("task");

            if (task.AssignedUser != null)
                task.AssignedUser.UnAssignTask(task);

            TakeTask(task);
        }
Example #11
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="count"></param>
        /// <param name="story"></param>
        public void TaskRow(int count)
        {
            PropertyBag.Add("count", count);
            Task task = new Task();
            PropertyBag.Add("task", task);

            CancelLayout();
        }
Example #12
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="taskId"></param>
 /// <param name="omschrijving"></param>
 /// <param name="story"></param>
 public void Opslaan(int taskId, string omschrijving, [ARFetch("storyId")] Story story)
 {
     Task task;
     if (taskId == 0)
     {
         task = new Task(story);
     }
     else
     {
         task = TaskRepository.Load(taskId);
         if (task == null)
         {
             task = new Task(story);
         }
     }
     task.Omschrijving = omschrijving;
     TaskRepository.Save(task);
     CancelView();
 }
Example #13
0
 /// <summary>
 /// Pak de gegeven taak op
 /// </summary>
 /// <param name="taak">De taak.</param>
 public virtual void PakTaakOp(Task taak)
 {
     if (!taken.Contains(taak))
         taken.Add(taak);
     taak.Behandelaar = this;
     taak.Status = Status.Opgepakt;
 }
Example #14
0
        /// <summary>
        /// Neemt de gegeven taak over van de huidige behandelaar
        /// </summary>
        /// <param name="task"></param>
        public virtual void NeemTaakOver(Task task)
        {
            if (task == null)
                throw new ArgumentNullException("task");

            if (task.Behandelaar != null)
                task.Behandelaar.GeefTaakAf(task);

            PakTaakOp(task);
        }
Example #15
0
 /// <summary>
 /// De behandelaar heeft de taak opgegeven en wenst niet langer de behandelaar te zijn van de gegeven taak
 /// </summary>
 /// <param name="taak">De taak.</param>
 public virtual void GeefTaakAf(Task taak)
 {
     if (taken.Contains(taak))
         taken.Remove(taak);
     taak.Behandelaar = null;
     taak.Status = Status.NietOpgepakt;
 }
Example #16
0
 /// <summary>
 /// Take the given task
 /// </summary>
 /// <param name="task">The task.</param>
 public virtual void TakeTask(Task task)
 {
     if (!tasks.Contains(task))
         tasks.Add(task);
     task.AssignedUser = this;
     task.State = State.Taken;
 }
Example #17
0
 /// <summary>
 /// The assigned user gives the task up and is no longer the assigned user. 
 /// The tasks state is set to open again.
 /// </summary>
 /// <param name="task">The taks.</param>
 public virtual void UnAssignTask(Task task)
 {
     if (tasks.Contains(task))
         tasks.Remove(task);
     task.AssignedUser = null;
     task.State = State.Open;
 }
Example #18
0
 private static Task Persist(Task task)
 {
     return taskRepository.Save(task);
 }