示例#1
0
        public void RecordLike_IfNotAlreadyLiked()
        {
            Subscriber sub = new Subscriber();
            Video vid1 = new Video();
            vid1.SetNumberOfLikes(10);
            vid1.SetVideoTitle("Vid001");
            int expected = 11; 
            

            if (!(sub.getVideosLiked().Contains(vid1.GetVideoTitle())))
            {
                sub.RecordLike(vid1);
            }
            int actual = vid1.GetNumberOfLikes();
            Assert.AreEqual(expected, actual, 0, "The Like Was Not Recorded");
        }
示例#2
0
        public void RecordLike_IfAlreadyLiked()
        {
            Subscriber sub = new Subscriber();
            Video vid = new Video();
            vid.SetNumberOfLikes(10);
            vid.SetVideoTitle("Vid001");
            sub.addToVideosLiked("Vid001");
            int expected = 11;
            List<String> videosLiked = sub.getVideosLiked();

            if(videosLiked.Contains(vid.GetVideoTitle()))
            {
                sub.RecordLike(vid);
            }

            int actual = vid.GetNumberOfLikes();
            Assert.AreEqual(expected, actual, 0, "The Like Was Successfully Recorded");
        }