diff options
| author | Danail Dimitrov <danaildimitrov321@gmail.com> | 2021-02-04 19:50:26 +0200 |
|---|---|---|
| committer | Danail Dimitrov <danaildimitrov321@gmail.com> | 2021-02-04 19:50:26 +0200 |
| commit | bce76440d537855ad486869d5b7bbc0e3adc8a45 (patch) | |
| tree | 07ac95e7c0ac1f2ae12bdda6d47574208a051dd1 /src/DevHive.Services/Services/CommentService.cs | |
| parent | cab9d359b2f0b2924583cdad58192cf1170dde63 (diff) | |
| download | DevHive-bce76440d537855ad486869d5b7bbc0e3adc8a45.tar DevHive-bce76440d537855ad486869d5b7bbc0e3adc8a45.tar.gz DevHive-bce76440d537855ad486869d5b7bbc0e3adc8a45.zip | |
Adding CommentController tests
Diffstat (limited to 'src/DevHive.Services/Services/CommentService.cs')
| -rw-r--r-- | src/DevHive.Services/Services/CommentService.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/DevHive.Services/Services/CommentService.cs b/src/DevHive.Services/Services/CommentService.cs index 3584e3a..e2b54c4 100644 --- a/src/DevHive.Services/Services/CommentService.cs +++ b/src/DevHive.Services/Services/CommentService.cs @@ -104,8 +104,8 @@ namespace DevHive.Services.Services #region Validations /// <summary> - /// Checks whether the user Id in the token and the given user Id match - /// </summary> + /// Checks whether the user Id in the token and the given user Id match + /// </summary> public async Task<bool> ValidateJwtForCreating(Guid userId, string rawTokenData) { User user = await this.GetUserForValidation(rawTokenData); @@ -114,10 +114,10 @@ namespace DevHive.Services.Services } /// <summary> - /// Checks whether the comment, gotten with the commentId, + /// Checks whether the comment, gotten with the commentId, /// is made by the user in the token /// or if the user in the token is an admin - /// </summary> + /// </summary> public async Task<bool> ValidateJwtForComment(Guid commentId, string rawTokenData) { Comment comment = await this._commentRepository.GetByIdAsync(commentId) ?? @@ -135,8 +135,8 @@ namespace DevHive.Services.Services } /// <summary> - /// Returns the user, via their Id in the token - /// </summary> + /// Returns the user, via their Id in the token + /// </summary> private async Task<User> GetUserForValidation(string rawTokenData) { JwtSecurityToken jwt = new JwtSecurityTokenHandler().ReadJwtToken(rawTokenData.Remove(0, 7)); @@ -151,8 +151,8 @@ namespace DevHive.Services.Services } /// <summary> - /// Returns all values from a given claim type - /// </summary> + /// Returns all values from a given claim type + /// </summary> private List<string> GetClaimTypeValues(string type, IEnumerable<Claim> claims) { List<string> toReturn = new(); |
