public void Setup()
 {
     user = new User();
     var userToFollow = new User();
     firstPost = new Post { Body = "done!" };
     userToFollow.AddPost(firstPost);
     user.ToggleFollowing(userToFollow);
 }
示例#2
0
        public ActionResult ToggleFollowing(User user)
        {
            var handle = GetUserHandleFromUri(Request.UrlReferrer);
            var userToFollow = userRepository.GetUserByHandle(handle);

            user.ToggleFollowing(userToFollow);

            return Content("<div></div>", "text/html");
        }
        public void AddFollowingWhenUserSelectedIsNotAlreadyInTheCollection()
        {
            var user = new User {Handle = "foo"};
            var userToFollow = new User {Handle = "bar"};

            user.ToggleFollowing(userToFollow);

            Assert.That(user.Following, Has.Member(userToFollow));
        }