public FacebookPage(string accessToken) { if (null == fbAgent) { fbAgent = new FacebookAgent(); } //fbAgent.AccessToken = accessToken; }
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 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."); }
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 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."); }
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."); }
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."); }
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."); }
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."); }
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."); }
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."); }
//TOBE: Used by the tests only public FacebookPage(IFacebookAgent agent) { this.fbAgent = agent; }
public FacebookPage() { fbAgent = new FacebookAgent(); //fbAgent.FacebookLogin(); }
public FacebookPage(string accessToken) { if (null == fbAgent) fbAgent = new FacebookAgent(); //fbAgent.AccessToken = accessToken; }