public void AddPostTest() { this.facade = new FacebookFacade(); bool result = facade.PostPictureMesssage("I like it.", @"C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg", "*****@*****.**"); Assert.IsTrue(result, "Posting an image failed."); }
public void PostPictureMesssageWithValidParametersTest() { bool IsPagePostPictureMesssageCalled = false; this.FacebookPageStub = new StubIFacebookPage() { AddPostIFacebookPostData = (PostData) => { IsPagePostPictureMesssageCalled = true; return true; } }; this.facade = new FacebookFacade(FacebookPageStub); facade.PostPictureMesssage("Hi", "C:\\", "*****@*****.**"); Assert.IsTrue(IsPagePostPictureMesssageCalled, "Page.PostPictureMesssage not called from Facade when all the parameters are valid."); }
public void PostPictureMesssageWithNullMessageTest() { bool IsPagePostPictureMesssageCalled = false; this.FacebookPageStub = new StubIFacebookPage() { AddPostIFacebookPostData = (PostData) => { IsPagePostPictureMesssageCalled = true; return true; } }; this.facade = new FacebookFacade(FacebookPageStub); facade.PostPictureMesssage(null, "C:\\", null); Assert.IsTrue(IsPagePostPictureMesssageCalled, "Page.AddPost not called from Facade when message of the post is null."); }
public void PostPictureMesssageWithNullPicUrlTest() { this.FacebookPageStub = new StubIFacebookPage() { GetAllCommentsForPostString = (postID) => { return new List<FacebookComment>(); } }; this.facade = new FacebookFacade(FacebookPageStub); facade.PostPictureMesssage(null, null, null); }
public ActionResult AddPost() { FacebookFacade facade = new FacebookFacade(); facade.PostPictureMesssage("This is TEst image1", @"C:\Users\Public\Pictures\Sample Pictures\Penguins.jpg", "*****@*****.**"); return View("Success"); }