Exemple #1
0
        public void Unfollow_MissingFollowing_ShouldReturnNotFound()
        {
            Following following = null;

            _mockRepo.Setup(r => r.GetFollowing(_userId, "1")).Returns(following);

            var res = _controller.Unfollow(_userId);

            res.Should().BeOfType <NotFoundResult>();
        }
Exemple #2
0
        public void Unfollow_AttemptingToUnfollowNotExistentFollowing_ShouldReturnBadRequest()
        {
            // Arrange
            _mockFollowingsRepository.Setup(r => r.GetFollowing(_UserId, _UserId + "-")).Returns((Following)null);

            // Act
            var result = _controller.Unfollow(_UserId + "-").Result;

            // Assert
            Assert.IsInstanceOf <NotFoundResult>(result);
        }
Exemple #3
0
        public void Unfollow_UserNotAlreadyFollowing_ShouldReturnNotFound()
        {
            var result = _controller.Unfollow("1");

            result.Should().BeOfType <NotFoundResult>();
        }
        public void Unfollow_NoFollowerWithGivenIdExists_ShouldReturnNotFound()
        {
            var result = _controller.Unfollow("1");

            result.Should().BeOfType <NotFoundResult>();
        }
        public void Unfollow_NoFollowingWithProvidedId_ShouldReturnNotFound()
        {
            var result = _controller.Unfollow("-1");

            result.Should().BeOfType <NotFoundResult>();
        }