Ejemplo n.º 1
0
 public FacebookPage(string accessToken)
 {
     if (null == fbAgent)
     {
         fbAgent = new FacebookAgent();
     }
     //fbAgent.AccessToken = accessToken;
 }
Ejemplo n.º 2
0
        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.");
        }
Ejemplo n.º 3
0
        public void GetAllCommentsWithValidParameterTest()
        {
            bool IsFAgentGetAllCommentsCalled = false;
            this.fAgent = new StubIFacebookAgent()
            {
                IsLoggedGet = () => {return true; },
                GetAllCommentsForPostString = (postID) => { IsFAgentGetAllCommentsCalled = true; return new List<FacebookComment>(); }
            };
            this.target = new FacebookPage(fAgent);
            target.GetAllCommentsForPost("132");

            Assert.IsTrue(IsFAgentGetAllCommentsCalled, "Facade didn't call FacebookAgent.GetAllComments.");
        }
Ejemplo n.º 4
0
        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.");
        }
Ejemplo n.º 5
0
        public void GetAllCommentsWithValidParameterTest()
        {
            bool IsFAgentGetAllCommentsCalled = false;

            this.fAgent = new StubIFacebookAgent()
            {
                IsLoggedGet = () => { return(true); },
                GetAllCommentsForPostString = (postID) => { IsFAgentGetAllCommentsCalled = true; return(new List <FacebookComment>()); }
            };
            this.target = new FacebookPage(fAgent);
            target.GetAllCommentsForPost("132");

            Assert.IsTrue(IsFAgentGetAllCommentsCalled, "Facade didn't call FacebookAgent.GetAllComments.");
        }
Ejemplo n.º 6
0
        public void GetAllPostsTest()
        {
            bool IsFAgentGetAllPostsCalled = false;

            this.fAgent = new StubIFacebookAgent()
            {
                IsLoggedGet = () => { return(true); },
                GetAllFeeds = () => { IsFAgentGetAllPostsCalled = true; return(new List <IFacebookPost>()); }
            };
            this.target = new FacebookPage(fAgent);
            target.GetAllPosts();

            Assert.IsTrue(IsFAgentGetAllPostsCalled, "Page.GetAllPosts not called from Facade.");
        }
Ejemplo n.º 7
0
        public void PostPictureMesssageWithValidParametersTest()
        {
            bool IsPagePostPictureMesssageCalled = false;

            this.fAgent = new StubIFacebookAgent()
            {
                IsLoggedGet = () => { return(true); },
                AddPostIFacebookPostData = (PostData) => { IsPagePostPictureMesssageCalled = true; return(true); }
            };
            this.target = new FacebookPage(fAgent);
            target.AddPost(new FacebookPostData()
            {
                Message = "Hi", PictureUrl = "C:\\", TaggedUserEmail = "*****@*****.**"
            });
            Assert.IsTrue(IsPagePostPictureMesssageCalled, "Page.PostPictureMesssage not called from Facade when all the parameters are valid.");
        }
Ejemplo n.º 8
0
        public void PostPictureMesssageWithNullEmailIDTest()
        {
            bool IsPagePostPictureMesssageCalled = false;

            this.fAgent = new StubIFacebookAgent()
            {
                IsLoggedGet = () => { return(true); },
                AddPostIFacebookPostData = (PostData) => { IsPagePostPictureMesssageCalled = true; return(true); }
            };
            this.target = new FacebookPage(fAgent);
            target.AddPost(new FacebookPostData()
            {
                Message = "Hi", PictureUrl = "C:\\", TaggedUserEmail = null
            });
            Assert.IsTrue(IsPagePostPictureMesssageCalled, "Page.AddPost not called from Facade when tagged email id of the post is null.");
        }
Ejemplo n.º 9
0
        public void GetAllPostsTest()
        {
            bool IsFAgentGetAllPostsCalled = false;
            this.fAgent = new StubIFacebookAgent()
            {
                IsLoggedGet = () => { return true; },
                GetAllFeeds = () => { IsFAgentGetAllPostsCalled = true; return new List<IFacebookPost>(); }
            };
            this.target = new FacebookPage(fAgent);
            target.GetAllPosts();

            Assert.IsTrue(IsFAgentGetAllPostsCalled, "Page.GetAllPosts not called from Facade.");
        }
Ejemplo n.º 10
0
 public void PostPictureMesssageWithValidParametersTest()
 {
     bool IsPagePostPictureMesssageCalled = false;
     this.fAgent = new StubIFacebookAgent()
     {
         IsLoggedGet = () => { return true; },
         AddPostIFacebookPostData = (PostData) => { IsPagePostPictureMesssageCalled = true; return true; }
     };
     this.target = new FacebookPage(fAgent);
     target.AddPost(new FacebookPostData() { Message = "Hi", PictureUrl = "C:\\", TaggedUserEmail = "*****@*****.**" });
     Assert.IsTrue(IsPagePostPictureMesssageCalled, "Page.PostPictureMesssage not called from Facade when all the parameters are valid.");
 }
Ejemplo n.º 11
0
 public void PostPictureMesssageWithNullMessageTest()
 {
     bool IsPagePostPictureMesssageCalled = false;
     this.fAgent = new StubIFacebookAgent()
     {
         IsLoggedGet = () => { return true; },
         AddPostIFacebookPostData = (PostData) => { IsPagePostPictureMesssageCalled = true; return true; }
     };
     this.target = new FacebookPage(fAgent);
     target.AddPost(new FacebookPostData() { Message = null, PictureUrl = "C:\\", TaggedUserEmail = null });
     Assert.IsTrue(IsPagePostPictureMesssageCalled, "Page.AddPost not called from Facade when message of the post is null.");
 }
Ejemplo n.º 12
0
 //TOBE: Used by the tests only
 public FacebookPage(IFacebookAgent agent)
 {
     this.fbAgent = agent;
 }
Ejemplo n.º 13
0
 public FacebookPage()
 {
     fbAgent = new FacebookAgent();
     //fbAgent.FacebookLogin();
 }
Ejemplo n.º 14
0
 public FacebookPage(string accessToken)
 {
     if (null == fbAgent)
         fbAgent = new FacebookAgent();
     //fbAgent.AccessToken = accessToken;
 }
Ejemplo n.º 15
0
 //TOBE: Used by the tests only
 public FacebookPage(IFacebookAgent agent)
 {
     this.fbAgent = agent;
 }
Ejemplo n.º 16
0
 public FacebookPage()
 {
     fbAgent = new FacebookAgent();
     //fbAgent.FacebookLogin();
 }