Пример #1
0
        public void AddVideo_Success_Test()
        {
            // Arrange

            var repo  = new JsonVideoRepository();
            var video = MakeTestVideo();

            // Act

            repo.Add(video);
            var result = repo.GetVideo(video.VideoUrl);

            // Assert

            Assert.Equal(video, result);
        }
Пример #2
0
        public void GetVideo_Null_Test()
        {
            // Arrange

            var repo  = new JsonVideoRepository();
            var video = MakeTestVideo();

            repo.Add(video);

            // Act

            var result = repo.GetVideo("unknown");

            // Assert

            Assert.Null(result);
        }
Пример #3
0
        public void RemoveByUrl_Success_Test()
        {
            // Arrange

            var repo  = new JsonVideoRepository();
            var video = MakeTestVideo();

            repo.Add(video);

            // Act

            repo.Remove(video.VideoUrl);
            var result = repo.GetVideo(video.VideoUrl);

            // Assert

            Assert.Null(result);
        }