Beispiel #1
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"));
        }
        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 PostPictureMesssageWithNullPicUrlTest()
 {
     this.FacebookPageStub = new StubIFacebookPage()
     {
         GetAllCommentsForPostString = (postID) => { return(new List <FacebookComment>()); }
     };
     this.facade = new FacebookFacade(FacebookPageStub);
     facade.PostPictureMesssage(null, null, null);
 }
        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 PostPictureMesssageWithNullEmailIDTest()
        {
            bool IsPagePostPictureMesssageCalled = false;

            this.FacebookPageStub = new StubIFacebookPage()
            {
                AddPostIFacebookPostData = (PostData) => { IsPagePostPictureMesssageCalled = true; return(true); }
            };
            this.facade = new FacebookFacade(FacebookPageStub);
            facade.PostPictureMesssage("Hi", "C:\\", null);
            Assert.IsTrue(IsPagePostPictureMesssageCalled, "Page.AddPost not called from Facade when tagged email id of the post is null.");
        }