Example #1
0
        public void GetTasks_NoCriterias_AllTasks()
        {
            var context = new AlvTimeDbContextBuilder()
                          .WithTasks()
                          .WithProjects()
                          .WithCustomers()
                          .CreateDbContext();

            var storage = new TaskStorage(context);

            var tasks = storage.GetUsersTasks(new TaskQuerySearch(), 1);

            Assert.Equal(context.Task.Count(), tasks.Count());
        }
Example #2
0
        public void GetTasks_ProjectIsGiven_AllTasksWithSpecifiedProject()
        {
            var context = new AlvTimeDbContextBuilder()
                          .WithTasks()
                          .WithProjects()
                          .WithCustomers()
                          .CreateDbContext();

            var storage = new TaskStorage(context);
            var tasks   = storage.GetUsersTasks(new TaskQuerySearch
            {
                Project = 1
            }, 1);

            Assert.True(1 == tasks.Single().Project.Id);
        }