public void GenericConnectorShouldReturnViewResult()
        {
            //Arrange
            var rendering = new Sitecore.Mvc.Presentation.Rendering();
            rendering.Parameters["NetworkName"] = "SocialNetworkName";
            A.CallTo(() => renderingContext.Rendering)
                .Returns<Sitecore.Mvc.Presentation.Rendering>(rendering);

            var user = new TestUser(true);
            A.CallTo(() => authenticationManager.GetActiveUser())
                .Returns<User>(user);

            //Act
            var result = controller.GenericConnector() as ViewResult;

            //Assert
            Assert.NotNull(result);
        }
        public void TwitterTweetShouldPopulateViewbag()
        {
            //Arrange
            var rendering = new Sitecore.Mvc.Presentation.Rendering();
            rendering.Parameters["NetworkName"] = "SocialNetworkName";
            A.CallTo(() => renderingContext.Rendering)
                .Returns<Sitecore.Mvc.Presentation.Rendering>(rendering);

            var user = new TestUser(true);
            A.CallTo(() => authenticationManager.GetActiveUser())
                .Returns<User>(user);

            var testItem = new TestItem();
            A.CallTo(() => pageContext.Item)
                .Returns(testItem);

            //Act
            var result = controller.TwitterTweet() as ViewResult;

            //Assert
            Assert.NotNull(result.ViewBag.ItemId);
            Assert.NotNull(result.ViewBag.EventName);
            Assert.NotNull(result.ViewBag.EventUrl); ;
            Assert.NotNull(result.ViewBag.GoalName);
            Assert.NotNull(result.ViewBag.CampaignQueryString);
            Assert.NotNull(result.ViewBag.SharePageUrl);
        }
        public void FacebookLikeShouldReturnViewResult()
        {
            //Arrange
            var rendering = new Sitecore.Mvc.Presentation.Rendering();
            rendering.Parameters["NetworkName"] = "SocialNetworkName";
            A.CallTo(() => renderingContext.Rendering)
                .Returns<Sitecore.Mvc.Presentation.Rendering>(rendering);

            var user = new TestUser(true);
            A.CallTo(() => authenticationManager.GetActiveUser()).Returns<User>(user);

            A.CallTo(() => linkManager.GetDefaultUrlOptions())
                .Returns(new Sitecore.Links.UrlOptions());
            A.CallTo(() => linkManager.GetItemUrl(A<Item>.Ignored))
                .Returns("http://host/path");

            A.CallTo(() => pageContext.Item)
                .Returns(new TestItem());


            //Act
            var result = controller.FacebookLike() as ViewResult;

            //Assert
            Assert.NotNull(result);
        }