Example #1
0
        public void DeveRetornarTarefasApenasDoUsuarioInformadoQueEstejamIncompletas()
        {
            _items.FirstOrDefault().MarkAsDone();
            var result = _items.AsQueryable().Where(TodoQueries.GetAllUndone("Usuario1"));

            Assert.AreEqual(3, result.Count());
        }
Example #2
0
 public IEnumerable <TodoItem> GetAllUndone(string user)
 {
     return(_context.Todos
            .AsNoTracking()
            .Where(TodoQueries.GetAllUndone(user))
            .OrderBy(x => x.Date));
 }
 public IEnumerable <TodoItem> GetAllUndone(string email)
 {
     return(_context.Todos
            .AsNoTracking()
            .Where(TodoQueries.GetAllUndone(email))
            .OrderBy(t => t.Date));
 }
Example #4
0
        public void GetAllUndone()
        {
            _items[0].MarkAsDone();

            var result = _items.AsQueryable().Where(TodoQueries.GetAllUndone("*****@*****.**"));

            Assert.AreEqual(1, result.Count());
        }
Example #5
0
 public async Task <IEnumerable <TodoItem> > GetAllUndoneAsync(string user)
 {
     return(await _context.Todos
            .AsNoTracking()
            .Where(TodoQueries.GetAllUndone(user))
            .OrderBy(x => x.Date)
            .ToListAsync());
 }
 public IEnumerable <TodoItem> GetAllUndone(string refUser)
 {
     return(_items.AsQueryable().
            Where(TodoQueries.GetAllUndone(refUser)).OrderBy(x => x.Date));
 }
Example #7
0
        public void Dada_consulta_retornar_tarefas_nao_feitas_do_usuario()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetAllUndone("mightyfool"));

            Assert.AreEqual(2, result.Count());
        }
Example #8
0
        public void Should_return_only_todo_undone_of_willian()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetAllUndone("willian"));

            Assert.AreEqual(2, result.Count());
        }
        public void Data_a_consulta_deve_retornar_1_tarefa_apenas_do_usuario_abner_math()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetAllUndone("abner_math"));

            Assert.AreEqual(1, result.Count());
        }
Example #10
0
 public IList <TodoItem> GetAllUndone(string user)
 {
     return(_dbSet.AsNoTracking()
            .Where(TodoQueries.GetAllUndone(user)).OrderBy(x => x.Date).ToList());
 }
Example #11
0
        public void Dada_a_consulta_deve_retonar_apenas_tarefas_incompletas_do_usuario_felipemachado()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetAllUndone("felipemachado"));

            Assert.True(result.Count() == 2);
        }
Example #12
0
        public void Dada_a_consulta_deve_retornar_tarefas_em_aberto_do_usuario_Usuario_A()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetAllUndone("usuario A"));

            Assert.AreEqual(2, result.Count());
        }
Example #13
0
        public void Deve_retornar_tarefas_não_prontas_apenas_do_usuario_patriciamatta()
        {
            var result = _items.AsQueryable().Where(TodoQueries.GetAllUndone("patriciamatta"));

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