Example #1
0
        public void CrudQuestion()
        {
            try
            {
                QuestionsFacade facade   = new QuestionsFacade();
                Question        question = new Question()
                {
                    Description = "Where and When?", Number = 99
                };

                // Create
                facade.Save(question);

                // Read by ID
                question = facade.GetQuestion(question.ID);

                // Update
                question.Description = "***" + question.Description;
                question.Number      = question.Number + 1000;
                facade.Update(question);

                // Delete
                facade.Delete(question.ID);

                Assert.AreEqual(true, true, "Sucesso!!");
            }
            catch (Exception ex)
            {
                Assert.AreEqual(true, false, ex.Message);
            }
        }
        public bool Delete(long id)
        {
            bool returnValue = false;

            QuestionsFacade facade = new QuestionsFacade();

            returnValue = facade.Delete(id);

            return(returnValue);
        }