コード例 #1
0
        public static List <PomodoroSession> CreateStatisticData(int taskCount, int dailypomodoroCount, DateTime startTime, DateTime finishTime)
        {
            List <PomodoroSession> sessions   = new List <PomodoroSession>();
            List <TaskStatistic>   statistics = new List <TaskStatistic>();
            var userTasks = new List <UserTask>();

            for (int i = 0; i < 100; i++)
            {
                userTasks.Add(MockDataService.CreateUserTask());
            }

            var dayCount = (finishTime - startTime).TotalDays;

            var r          = new Random();
            int startCount = dailypomodoroCount / 2;

            for (int d = 0; d < dayCount; d++)
            {
                var session = new PomodoroSession()
                {
                    Day = startTime.AddDays(d), Id = Guid.NewGuid()
                };
                for (int i = 0; i < startCount; i++)
                {
                    var           taskIndex = new Random().Next() % userTasks.Count;
                    TaskStatistic s         = new TaskStatistic();
                    s.Duration     = TimeSpan.FromMinutes(20);
                    s.Id           = Guid.NewGuid();
                    s.TaskId       = userTasks[taskIndex].Id;
                    s.TaskName     = userTasks[taskIndex].TaskName;
                    s.FinishedTime = startTime.AddDays(d);
                    session.FinishedTaskInfo.Add(s);
                }

                if (startCount > dailypomodoroCount)
                {
                    startCount = dailypomodoroCount / 2;
                }
                startCount++;
                sessions.Add(session);
            }

            return(sessions);
        }
コード例 #2
0
 public bool UpdateSessionInfo(PomodoroSession currentSession)
 {
     throw new NotImplementedException();
 }
コード例 #3
0
 Task <bool> IStorageService.UpdateSessionInfo(PomodoroSession currentSession)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 public Task <bool> UpdateSessionInfo(PomodoroSession currentSession)
 {
     return(Task.FromResult(true));
 }