Esempio n. 1
0
        public IActionResult Index([FromHeader] string sendJson)
        {
            ViewBag.Active = "Video";
            var model = VideoDBConnector.GetVideos(Constants.DATA_SOURCE);

            return(sendJson != null && sendJson.Equals("True") ? Json(model) : (IActionResult)View(model));
        }
        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);
        }
        public void TestRetrieveAll()
        {
            List <Video> videos = VideoDBConnector.GetVideos(dataSource);

            Assert.NotNull(videos);
        }