private PersonTask CloneTask(PersonTask task)
        {
            PersonTask newTask;
            if (task is JiraPersonTask)
                newTask = new JiraPersonTask(task.Name);
            else
                newTask = new CustomPersonTask(task.Name);

            newTask.Id = task.Id;
            newTask.WorkMonthId = task.WorkMonthId;
            newTask.Project = task.Project;
            newTask.StartTime = null;
            newTask.Hours = null;
            newTask.MultipleDays = true;

            return newTask;
        }
        public void TimeManager_GetPersonTasksWithTime_OneCustomTask_TimeAndHoursShouldBeNotChanged()
        {
            const int daysCount = 30;

            var hours = TimeSpan.FromHours(2);
            var days = new WorkDayFactory().GetWorkDays(Year, Month, daysCount);
            var task = new CustomPersonTask("custom") { Hours = hours, StartTime = days[10].Date };

            var personWorkMonth = TimeManager_GetPersonWorkMonthWithoutData();
            personWorkMonth.PersonTasks = new List<PersonTask> { task };
            personWorkMonth.WorkDays = days;

            var timeManager = new PersonTimeManager(new TimeSpan(8, 0, 0));
            personWorkMonth.PersonTasks = timeManager.GetPersonTasksWithTime(personWorkMonth.PersonTasks, personWorkMonth.WorkDays);

            var workMonthHelper = new WorkMonthHelper();
            var actualResult = workMonthHelper.ActualWorkTime(personWorkMonth).Ticks;
            var expectedResult = hours.Ticks;

            Assert.AreEqual(expectedResult, actualResult);
            Assert.AreEqual(daysCount, personWorkMonth.WorkDays.Count);
            Assert.AreEqual(personWorkMonth.PersonTasks[0].Hours, hours);
            Assert.IsTrue(days[10].Date.Equals(personWorkMonth.PersonTasks[0].StartTime.Value));
        }