Exemple #1
0
        public void TestMethodUpdateFaq()
        {
            var faq = new Faq
            {
                Active = State.Active,
                Content = "test faq content",
                Order = 1,
                SeoUrl = "test-faq-content",
                Title = "test faq title"
            };

            _faqService.Insert(faq);
            _uow.SaveChanges();

            faq.Title = "updated test faq title";
            faq.Content = "updated test faq content data";
            _faqService.Update(faq);
            Assert.AreEqual(1, _uow.SaveChanges());

            var updatedFaq = _faqService.Find(faq.Id);
            Assert.AreEqual(faq, updatedFaq);

            _faqService.Delete(faq);
            _uow.SaveChanges();
        }
        public ActionResult FaqAdd(FaqModel model)
        {
            Faq faq = new Faq
            {
                Id = model.Id,
                Active = model.Active,
                Content = model.Content,
                Order = model.Order,
                Title = model.Title
            };

            _faqService.Insert(faq);
            _uow.SaveChanges();

            return RedirectToAction("ListFaq");
        }
Exemple #3
0
        public void TestMethodInsertFaq()
        {
            var faq = new Faq
            {
                Active = State.Active,
                Content = "test faq content",
                Order = 1,
                SeoUrl = "test-faq-content",
                Title = "test faq title"
            };

            _faqService.Insert(faq);
            Assert.AreEqual(1, _uow.SaveChanges());

            _faqService.Delete(faq);
            _uow.SaveChanges();
        }
Exemple #4
0
 /// <summary>
 /// Delete a faq by faq entity.
 /// </summary>
 /// <param name="faq">Faq</param>
 public void Delete(Faq faq)
 {
     _faqRepository.Delete(faq);
 }
Exemple #5
0
 /// <summary>
 /// Update a faq.
 /// </summary>
 /// <param name="faq"></param>
 public void Update(Faq faq)
 {
     _faqRepository.Update(faq);
 }
Exemple #6
0
 /// <summary>
 /// Insert new faq.
 /// </summary>
 /// <param name="faq"></param>
 public void Insert(Faq faq)
 {
     _faqRepository.Insert(faq);
 }