Пример #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");
        }
Пример #3
0
 public void IsPasswordCompliant_IfCorrectInput()
 {
     Subscriber sub = new Subscriber();
     Assert.IsTrue(sub.IsPasswordCompliant("Password1"));
 }
Пример #4
0
 public void IsPasswordCompliant_IfNoLowerCase()
 {
     Subscriber sub = new Subscriber();
     Assert.IsFalse(sub.IsPasswordCompliant("PASSWORD"));
 }
Пример #5
0
 public void IsPasswordCompliant_IfNoUpperCase()
 {
     Subscriber sub = new Subscriber();
     Assert.IsFalse(sub.IsPasswordCompliant("password1"));
 }
Пример #6
0
 public void IsPasswordCompliant_IfMissingDigit()
 {
     Subscriber sub = new Subscriber();
     Assert.IsFalse(sub.IsPasswordCompliant("Password"));
 }
Пример #7
0
 public void IsPasswordCompliant_IfLengthLessThan8()
 {
     Subscriber sub = new Subscriber();
     Assert.IsFalse(sub.IsPasswordCompliant("Pass1"));
 }