示例#1
0
        public void Dada_a_consulta_deve_retornar_tarefas_apenas_do_periodo_correto()
        {
            var date   = _items.FirstOrDefault().Date;
            var result = _items.AsQueryable().Where(TodoQueries.GetByPeriod("usuarioA", date, false));

            Assert.AreEqual(2, result.Count());
        }
示例#2
0
 public IEnumerable <TodoItem> GetByPeriod(string user, DateTime date, bool done)
 {
     return(_context.Todos
            .AsNoTracking()
            .Where(TodoQueries.GetByPeriod(user, date, done))
            .OrderBy(x => x.Date));
 }
示例#3
0
        public void DeveRetornarTarefasApenasDoUsuarioInformadoPeloPeriodo()
        {
            _items.FirstOrDefault().MarkAsDone();
            var result = _items.AsQueryable().Where(TodoQueries.GetByPeriod("Usuario1", DateTime.Now, true));

            Assert.AreEqual(1, result.Count());
        }
示例#4
0
 public async Task <IEnumerable <TodoItem> > GetByPeriodAsync(string user, DateTime date, bool done)
 {
     return(await _context.Todos
            .AsNoTracking()
            .Where(TodoQueries.GetByPeriod(user, date, done))
            .OrderBy(x => x.Date)
            .ToListAsync());
 }
示例#5
0
        public void Dada_a_consulta_deve_retonar_tarefas_completas_de_um_periodo_do_usuario_felipemachado()
        {
            var result = _items.AsQueryable()
                         .Where(
                TodoQueries.GetByPeriod(
                    "felipemachado",
                    new DateTime(2010, 02, 02, 00, 00, 00),
                    true)
                );

            Assert.True(result.Count() == 0);
        }
示例#6
0
        public void Dada_consulta_retornar_tarefas_de_agora_nao_feitas_do_usuario()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetByPeriod("mightyfool", DateTime.Now, false));

            Assert.AreEqual(2, result.Count());
        }
示例#7
0
        public void Should_return_only_todo_of_a_day_done()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetByPeriod("willian", DateTime.Now, true));

            Assert.AreEqual(0, result.Count());
        }
示例#8
0
        public void Dada_consulta_deve_retornar_tarefas_por_periodo_false()
        {
            var result = _itens.AsQueryable().Where(TodoQueries.GetByPeriod("Carlos Soares", DateTime.Now, false));

            Assert.AreEqual(2, result.Count());
        }
示例#9
0
        public void Dada_a_consulta_deve_retornar_tarefas_em_aberto_de_hoje_do_usuario_Tales_Boalim()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetByPeriod("Tales Boalim", DateTime.Now, false));

            Assert.AreEqual(1, result.Count());
        }
示例#10
0
 public IEnumerable <TodoItem> GetByPeriod(string usuario, DateTime data, bool concluida)
 {
     return(_context.Todos.AsNoTracking().Where(TodoQueries.GetByPeriod(usuario, data, concluida)).OrderBy(x => x.Date));
 }
示例#11
0
        public void Deve_retornar_tarefas_do_periodo_apenas_do_usuario_patriciamatta()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetByPeriod("patriciamatta", DateTime.Now, false));

            Assert.AreEqual(1, result.Count());
        }