예제 #1
0
        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.");
        }
예제 #2
0
 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.");
 }
예제 #3
0
 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.");
 }
예제 #4
0
 public void PostPictureMesssageWithNullPicUrlTest()
 {
     this.FacebookPageStub = new StubIFacebookPage()
     {
         GetAllCommentsForPostString = (postID) => { return new List<FacebookComment>(); }
     };
     this.facade = new FacebookFacade(FacebookPageStub);
     facade.PostPictureMesssage(null, null, null);
 }
예제 #5
0
 public ActionResult AddPost()
 {
     FacebookFacade facade = new FacebookFacade();
     facade.PostPictureMesssage("This is TEst image1", @"C:\Users\Public\Pictures\Sample Pictures\Penguins.jpg", "*****@*****.**");
     return View("Success");
 }