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));
        }
        public void TestInsert()
        {
            List <Video> videos = VideoDBConnector.GetVideos(dataSource);

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

            Video video = new Video();

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


            videos = VideoDBConnector.GetVideos(dataSource);
            Assert.NotNull(videos);
            Assert.Equal(count + 1, videos.Count);
        }
Exemplo n.º 3
0
        public IActionResult Add(Video video)
        {
            VideoDBConnector.Create(Constants.DATA_SOURCE, video);

            return(Redirect("/Videos"));
        }