public void Should_decrease_suggestions_count_after_accepting()
        {
            // Arrange
            var expected = _vacancySuggestionService.SuggestAllForUser(0).Count - 1;

            // Act
            var suggestion = _vacancySuggestionService.SuggestForUser(0);

            _vacancySuggestionService.AcceptSuggestionForUser(0, suggestion.Id);
            var result = _vacancySuggestionService.SuggestAllForUser(0).Count;

            // Assert
            Assert.That(result, Is.EqualTo(expected));
        }
Example #2
0
 public ActionResult <VacancySuggestionDto> Get([FromHeader] Guid token)
 {
     try
     {
         Int32 currentUserId = ValidateToken(token);
         return(Ok(_vacancySuggestionService.SuggestForUser(currentUserId)));
     }
     catch (AuthenticationException)
     {
         return(Unauthorized());
     }
     catch (ArgumentException e)
     {
         return(NotFound(e.Message));
     }
 }