Example #1
0
 /// <summary>
 /// Get the Profiles of users who liked the post
 /// </summary>
 /// <param name="postID">Post ID</param>
 /// <returns>Returns list of all the likes for the post</returns>
 public IEnumerable <IFacebookProfile> GetAllLikesForPost(string postID)
 {
     if (null == postID)
     {
         throw new ArgumentNullException("PostID", "Cannot get like for null post ID.");
     }
     return(page.GetAllLikesForPost(postID));
 }
        public void GetAllLikesWithValidParameterTest()
        {
            bool IsFAgentGetAllLikesCalled = false;

            this.fAgent = new StubIFacebookAgent()
            {
                IsLoggedGet = () => { return(true); },
                GetAllLikesForPostString = (postID) => { IsFAgentGetAllLikesCalled = true; return(new List <IFacebookProfile>()); }
            };
            this.target = new FacebookPage(fAgent);
            target.GetAllLikesForPost("132");

            Assert.IsTrue(IsFAgentGetAllLikesCalled, "Page.GetAllLikesForPost not called from Facade.");
        }
        public void GetAllLikesWithValidParameterTest()
        {
            bool IsFAgentGetAllLikesCalled = false;
            this.fAgent = new StubIFacebookAgent()
            {
                IsLoggedGet = () => { return true; },
                GetAllLikesForPostString = (postID) => { IsFAgentGetAllLikesCalled = true; return new List<IFacebookProfile>(); }
            };
            this.target = new FacebookPage(fAgent);
            target.GetAllLikesForPost("132");

            Assert.IsTrue(IsFAgentGetAllLikesCalled, "Page.GetAllLikesForPost not called from Facade.");
        }