Skip to content

Commit 117cafa

Browse files
Made small adjustments to the documentation
1 parent 52eddb0 commit 117cafa

File tree

7 files changed

+36
-39
lines changed

7 files changed

+36
-39
lines changed

Chirp/src/Chirp.Core/AuthorService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public interface IAuthorService
2727
/// </summary>
2828
/// <param name="userWhoFollow">username</param>
2929
/// <param name="userToFollow">username</param>
30-
/// <returns>True if the follow went through, false if there is a follow connection between the two users</returns>
31-
/// <exception cref="UserDoesNotExist">Thrown if a one of the users doesn't exist</exception>
30+
/// <returns>True if the follow went through, false if there already exists a follow connection between the two users</returns>
31+
/// <exception cref="UserDoesNotExist">Thrown if one of the users doesn't exist</exception>
3232
/// <exception cref="ArgumentException">Thrown if the value of <paramref name="userWhoFollow"/> is equal to <paramref name="userToFollow"/>.
3333
/// </exception>
3434
public bool Follow(string userWhoFollow, string userToFollow);
@@ -39,7 +39,7 @@ public interface IAuthorService
3939
/// <param name="userWhoFollows">username</param>
4040
/// <param name="userToUnFollow">username</param>
4141
/// <returns>True if the unfollow went through, false if there isn't a follow connection between the two users</returns>
42-
/// <exception cref="UserDoesNotExist">Thrown if a one of the users doesn't exist</exception>
42+
/// <exception cref="UserDoesNotExist">Thrown if one of the users doesn't exist</exception>
4343
/// <exception cref="ArgumentException">Thrown if the value of <paramref name="userWhoFollows"/> is equal to <paramref name="userToUnFollow"/>.
4444
/// </exception>
4545
public bool Unfollow(string userWhoFollows, string userToUnFollow);

Chirp/src/Chirp.Core/CheepService.cs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public interface ICheepService
1212
/// </summary>
1313
/// <param name="page">if it's less than or equal to zero, It's treated as 1</param>
1414
/// <param name="pageSize">how many cheeps are on a page. Must be greater than zero</param>
15-
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> less than one</exception>
15+
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> is less than one</exception>
1616
public IEnumerable<CheepDTO> GetCheepsByPage(int page, int pageSize);
1717

1818
/// <summary>
@@ -21,7 +21,7 @@ public interface ICheepService
2121
/// <param name="usernames"></param>
2222
/// <param name="page">if it's less than or equal to zero, It's treated as 1</param>
2323
/// <param name="pageSize">how many cheeps are on a page. Must be greater than zero</param>
24-
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> less than one</exception>
24+
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> is less than one</exception>
2525
public IEnumerable<CheepDTO> GetCheepsFromAuthorsByPage(IEnumerable<string> usernames, int page, int pageSize);
2626

2727
/// <summary>
@@ -31,22 +31,20 @@ public interface ICheepService
3131
public IEnumerable<CheepDTO> GetCheepsFromAuthor(string username);
3232

3333
/// <summary>
34-
/// Gets the amount of pages that are needed to display all the cheeps in the database,
35-
/// given the page size
34+
/// Gets the amount of pages cheeped by an author with a given page size
3635
/// </summary>
3736
/// <param name="pageSize">how many cheeps are on a page. Must be greater than zero</param>
3837
/// <returns>The result is rounded to the next larger int</returns>
39-
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> less than one</exception>
38+
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> is less than one</exception>
4039
public int GetAmountOfCheepPages(int pageSize);
4140

4241
/// <summary>
43-
/// Gets the amount of pages that are needed author to display all Cheeps made by the given authors,
44-
/// given the page size
42+
/// Gets the amount of pages cheeped by a collection of authors with a given page size
4543
/// </summary>
4644
/// <param name="usernames">the usernames of the authors</param>
4745
/// <param name="pageSize">how many cheeps are on a page. Must be greater than zero</param>
4846
/// <returns>the result is rounded to the next larger int</returns>
49-
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> less than one</exception>
47+
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> is less than one</exception>
5048
public int GetAmountOfCheepPagesFromAuthors(IEnumerable<string> usernames, int pageSize);
5149

5250
/// <summary>
@@ -61,26 +59,26 @@ public interface ICheepService
6159
/// Creates a new comment from the given CommentDTO
6260
/// </summary>
6361
/// <param name="comment"></param>
64-
/// <returns>True if a comment vas successfully created,
62+
/// <returns>True if a comment was successfully created,
6563
/// false if either the author said to have created the comment,
6664
/// or the cheep said to have been commented, doesn't exist</returns>
6765
public bool CreateComment(CommentDTO comment);
6866

6967
/// <summary>
70-
/// Gets the amount of Comments associated with the cheep that has the given CheepID
68+
/// Gets the amount of Comments associated with the cheep that has the given CheepId
7169
/// </summary>
7270
/// <param name="cheepId"></param>
7371
/// <returns>If <paramref name="cheepId"/> is null, 0 is returned</returns>
7472
public int GetCommentAmountOnCheep(int? cheepId);
7573

7674
/// <summary>
77-
/// Gets the Cheep associated with the given CheepID
75+
/// Gets the Cheep associated with the given CheepId
7876
/// </summary>
7977
/// <param name="cheepId"></param>
8078
public CheepDTO GetCheepFromId(int cheepId);
8179

8280
/// <summary>
83-
/// Gets all Comments associated with the cheep that has the given CheepID
81+
/// Gets all Comments associated with the cheep that has the given CheepId
8482
/// </summary>
8583
/// <param name="cheepId"></param>
8684
public IEnumerable<CommentDTO> GetCommentsFromCheep(int cheepId);
@@ -104,14 +102,14 @@ public interface ICheepService
104102
public bool UnlikeCheep(LikeDTO like);
105103

106104
/// <summary>
107-
/// Gets how many Likes are associated with some Cheep given the CheepID
105+
/// Gets how many Likes are associated with some Cheep given the CheepId
108106
/// </summary>
109107
/// <param name="cheepId"></param>
110108
/// <returns>0 if there isn't a cheep associated with the given <paramref name="cheepId"/></returns>
111109
public Task<int> GetLikeCount(int cheepId);
112110

113111
/// <summary>
114-
/// Returns whether an author with the given usernames has liked the cheep with the given CheepID
112+
/// Returns whether an author with the given username has liked the cheep with the given CheepId
115113
/// </summary>
116114
/// <param name="cheepId"></param>
117115
/// <param name="username"></param>

Chirp/src/Chirp.Core/DTO/CheepDTO.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Chirp.Core.DTO;
22
/// <summary>
3-
/// The CheepDTO class transfors information about Cheeps from the CheepRepository to the UI
3+
/// The CheepDTO class transfers information about Cheeps from the CheepRepository to the UI
44
/// </summary>
55

66
public class CheepDTO(int? id, string author, string message, long unixTimestamp)

Chirp/src/Chirp.Core/IAuthorRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Chirp.Core;
66
public interface IAuthorRepository
77
{
88
/// <summary>
9-
/// Gets all authors with one of the given usernames
9+
/// Gets all authors by their given usernames
1010
/// </summary>
1111
/// <param name="usernames"></param>
1212
public Task<IEnumerable<AuthorDTO?>> GetAuthorsByNames(IEnumerable<string> usernames);
@@ -31,7 +31,7 @@ public interface IAuthorRepository
3131
/// <param name="userWhoFollow">username</param>
3232
/// <param name="userToFollow">username</param>
3333
/// <returns>True if the follow went through, false if there is a follow connection between the two users</returns>
34-
/// <exception cref="UserDoesNotExist">Thrown if a one of the users doesn't exist</exception>
34+
/// <exception cref="UserDoesNotExist">Thrown if one of the users doesn't exist</exception>
3535
/// <exception cref="ArgumentException">Thrown if the value of <paramref name="userWhoFollow"/> is equal to <paramref name="userToFollow"/>.
3636
/// </exception>
3737
public Task<bool> Follow(string userWhoFollow, string userToFollow);
@@ -42,7 +42,7 @@ public interface IAuthorRepository
4242
/// <param name="userWhoFollows">username</param>
4343
/// <param name="userToUnFollow">username</param>
4444
/// <returns>True if the unfollow went through, false if there isn't a follow connection between the two users</returns>
45-
/// <exception cref="UserDoesNotExist">Thrown if a one of the users doesn't exist</exception>
45+
/// <exception cref="UserDoesNotExist">Thrown if one of the users doesn't exist</exception>
4646
/// <exception cref="ArgumentException">Thrown if the value of <paramref name="userWhoFollows"/> is equal to <paramref name="userToUnFollow"/>.
4747
/// </exception>
4848
public Task<bool> UnFollow(string userWhoFollows, string userToUnFollow);

Chirp/src/Chirp.Core/ICheepRepository.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ public interface ICheepRepository
88
/// <summary>
99
/// Gets all Cheeps on the given page by the given page size
1010
/// </summary>
11-
/// <param name="page">if it's less than or equal to zero, It's treated as 1</param>
11+
/// <param name="page">if it's less than or equal to zero, it's treated as 1</param>
1212
/// <param name="pageSize">how many cheeps are on a page. Must be greater than zero</param>
13-
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> less than one</exception>
13+
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> is less than one</exception>
1414
public Task<IEnumerable<CheepDTO>?> GetCheepsByPage(int page, int pageSize);
1515

1616
/// <summary>
@@ -23,9 +23,9 @@ public interface ICheepRepository
2323
/// Gets Cheeps made by some authors with one of the given usernames by the given page and page size
2424
/// </summary>
2525
/// <param name="usernames"></param>
26-
/// <param name="page">if it's less than or equal to zero, It's treated as 1</param>
26+
/// <param name="page">if it's less than or equal to zero, it's treated as 1</param>
2727
/// <param name="pageSize">how many cheeps are on a page. Must be greater than zero</param>
28-
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> less than one</exception>
28+
/// <exception cref="ArgumentOutOfRangeException">Thrown if the <paramref name="pageSize"/> is less than one</exception>
2929
public Task<IEnumerable<CheepDTO>>
3030
GetCheepsFromAuthorsByPage(IEnumerable<string> usernames, int page, int pageSize);
3131

@@ -44,7 +44,7 @@ public Task<IEnumerable<CheepDTO>>
4444
public Task<int> GetAmountOfCheeps();
4545

4646
/// <summary>
47-
/// Gets the amount Cheeps made by the Authors with of the given usernames
47+
/// Gets the amount Cheeps made by the Authors by the given usernames
4848
/// </summary>
4949
/// <param name="usernames"></param>
5050
public Task<int> GetAmountOfCheepsFromAuthors(IEnumerable<string> usernames);
@@ -53,26 +53,26 @@ public Task<IEnumerable<CheepDTO>>
5353
/// Creates a new comment from the given CommentDTO
5454
/// </summary>
5555
/// <param name="comment"></param>
56-
/// <returns>True if a comment vas successfully created,
56+
/// <returns>True if a comment was successfully created,
5757
/// false if either the author said to have created the comment,
5858
/// or the cheep said to have been commented, doesn't exist</returns>
5959
public Task<bool> CreateComment(CommentDTO comment);
6060

6161
/// <summary>
62-
/// Gets the amount of Comments associated with the cheep that has the given CheepID
62+
/// Gets the amount of Comments associated with the cheep that has the given CheepId
6363
/// </summary>
6464
/// <param name="cheepId"></param>
6565
/// <returns>If <paramref name="cheepId"/> is null, 0 is returned</returns>
6666
public Task<int> GetCommentAmountOnCheep(int? cheepId);
6767

6868
/// <summary>
69-
/// Gets the Cheep associated with the given CheepID
69+
/// Gets the Cheep associated with the given CheepId
7070
/// </summary>
7171
/// <param name="cheepId"></param>
7272
public Task<CheepDTO> GetCheepById(int cheepId);
7373

7474
/// <summary>
75-
/// Gets all Comments associated with the cheep that has the given CheepID
75+
/// Gets all Comments associated with the cheep that has the given CheepId
7676
/// </summary>
7777
/// <param name="cheepId"></param>
7878
public Task<IEnumerable<CommentDTO>> GetCommentsForCheep(int cheepId);
@@ -96,14 +96,14 @@ public Task<IEnumerable<CheepDTO>>
9696
public Task<bool> UnlikeCheep(LikeDTO like);
9797

9898
/// <summary>
99-
/// Gets how many Likes are associated with some Cheep given the CheepID
99+
/// Gets how many Likes are associated with some Cheep given the CheepId
100100
/// </summary>
101101
/// <param name="cheepId"></param>
102102
/// <returns>0 if there isn't a cheep associated with the given <paramref name="cheepId"/></returns>
103103
Task<int> GetLikeCount(int cheepId);
104104

105105
/// <summary>
106-
/// Returns whether an author with the given usernames has liked the cheep with the given CheepID
106+
/// Returns whether an author with the given username has liked the cheep with the given CheepId
107107
/// </summary>
108108
/// <param name="cheepId"></param>
109109
/// <param name="username"></param>

Chirp/src/Chirp.Infrastructure/Model/Author.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
namespace Chirp.Infrastructure.Model;
55
/// <summary>
66
/// The Author class acts as the User for the Chirp! program
7-
/// an author is able to Cheep, Comment on Cheeps, like Cheeps
8-
/// and follow other Authors
7+
/// where an author is able to Create, Comment and/or Like Cheeps
8+
/// or Follow other Authors
99
/// </summary>
1010
public sealed class Author : IdentityUser
1111
{
@@ -33,8 +33,8 @@ public static Author CreateAuthor(AuthorDTO author)
3333
/// </summary>
3434
/// <param name="username"></param>
3535
/// <param name="email"></param>
36-
/// <returns></returns>
37-
/// <exception cref="ArgumentNullException"></exception>
36+
/// <returns>Returns the created Author with the given username and email</returns>
37+
/// <exception cref="ArgumentNullException">Thrown to specify that a username or email cannot be null</exception>
3838
public static Author CreateAuthor(string username, string email)
3939
{
4040
_ = username ?? throw new ArgumentNullException(nameof(username));

Chirp/src/Chirp.Infrastructure/Model/Cheep.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
namespace Chirp.Infrastructure.Model;
44
/// <summary>
5-
/// The Cheep class, represent a cheep, which is a small 160-character message that can
6-
/// be published by authors on the Chirp! platform,
7-
/// as well as commented and liked by authors
5+
/// The Cheep class represents the functionality of a Cheep; a 160-character long message that can be posted on the Chirp! application by a given Author.
6+
/// The Cheep can also be commented on and liked by an Author
87
/// </summary>
98
public class Cheep
109
{

0 commit comments

Comments
 (0)