public void TestDelete()
        {
            Video video = new Video();

            video.Title = "Test";
            video.Url   = "www.google.com";
            Assert.True(VideoDBConnector.Create(dataSource, video));

            Assert.True(FaqDBConnector.Delete(dataSource, 1));
        }
Exemple #2
0
        public void TestDelete()
        {
            Schedule schedule = new Schedule();

            schedule.EventTitle       = "Test title";
            schedule.EventDescription = "Description";
            schedule.StartTime        = "2018-01-22 22:11:32";
            Assert.True(ScheduleDBConnector.Create(dataSource, schedule));

            List <Schedule> schedules = ScheduleDBConnector.GetSchedules(dataSource, "SELECT * FROM Schedule ORDER BY datetime(StartTime)");

            Assert.NotNull(schedules);

            Assert.True(FaqDBConnector.Delete(dataSource, (int)schedules[0].Id));
        }
        public void TestDelete()
        {
            Faq faq = new Faq();

            faq.Question = "Test Question";
            faq.Answer   = "Test Answer";
            Assert.True(FaqDBConnector.Create(dataSource, faq));

            List <Faq> faqs = FaqDBConnector.GetFaqs(dataSource);

            Assert.NotNull(faqs);
            int count = faqs.Count;

            Assert.True(FaqDBConnector.Delete(dataSource, (int)faqs[0].Id));

            faqs = FaqDBConnector.GetFaqs(dataSource);

            Assert.NotNull(faqs);
            Assert.Equal(count - 1, faqs.Count);
        }
Exemple #4
0
 public IActionResult Delete(int id)
 {
     FaqDBConnector.Delete(Constants.DATA_SOURCE, id);
     return(Redirect("/Faq"));
 }