Skip to content

Commit 863269c

Browse files
committed
Rename some methods that contains "All" to without "All"
1 parent fbaa79f commit 863269c

7 files changed

Lines changed: 16 additions & 16 deletions

File tree

API.Test/TeachingTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public void GetSubject()
1717
{
1818
Client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
1919

20-
Task<Subject[]> subjects = Client.GetAllSubjectsAsync();
20+
Task<Subject[]> subjects = Client.GetSubjectsAsync();
2121
subjects.Wait();
2222
if (subjects.Result.Length > 0)
2323
Assert.Pass();
@@ -43,7 +43,7 @@ public void GetRoom()
4343
{
4444
Client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
4545

46-
Task<Room[]> rooms = Client.GetAllRoomsAsync();
46+
Task<Room[]> rooms = Client.GetRoomsAsync();
4747
rooms.Wait();
4848
if (rooms.Result.Length > 0)
4949
Assert.Pass();
@@ -56,7 +56,7 @@ public void GetDepartment()
5656
{
5757
Client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
5858

59-
Task<Department[]> departments = Client.GetAllDepartmentsAsync();
59+
Task<Department[]> departments = Client.GetDepartmentsAsync();
6060
departments.Wait();
6161
if (departments.Result != null)
6262
Assert.Pass();

API.Test/TimeTableTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void GetSchoolYears()
4343
{
4444
Client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
4545

46-
Task<SchoolYear[]> schoolYears = Client.GetAllSchoolYearsAsync();
46+
Task<SchoolYear[]> schoolYears = Client.GetSchoolYearsAsync();
4747
schoolYears.Wait();
4848
if (schoolYears.Result.Length > 0)
4949
Assert.Pass();
@@ -69,7 +69,7 @@ public void GetHolidays()
6969
{
7070
Client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
7171

72-
Task<Holidays[]> holidays = Client.GetAllHolidaysAsync();
72+
Task<Holidays[]> holidays = Client.GetHolidaysAsync();
7373
holidays.Wait();
7474
if (holidays.Result.Length > 0)
7575
Assert.Pass();

API.Test/UserTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void GetStudents()
2020
{
2121
Client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
2222

23-
Task<Student[]> students = Client.GetAllStudentsAsync();
23+
Task<Student[]> students = Client.GetStudentsAsync();
2424
students.Wait();
2525
if (students.Result.Length > 0)
2626
Assert.Pass();
@@ -34,7 +34,7 @@ public void GetTeachers()
3434
{
3535
Client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
3636

37-
Task<Teacher[]> teachers = Client.GetAllTeachersAsync();
37+
Task<Teacher[]> teachers = Client.GetTeachersAsync();
3838
teachers.Wait();
3939
if (teachers.Result.Length > 0)
4040
Assert.Pass();

WebUntisAPI.Client/WebUntisClient.Teaching.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public partial class WebUntisClient
2020
/// <exception cref="UnauthorizedAccessException">Thrown when you're logged in</exception>
2121
/// <exception cref="HttpRequestException">Thrown when an error happened while the http request</exception>
2222
/// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
23-
public async Task<Subject[]> GetAllSubjectsAsync(string id = "getSubjects", CancellationToken ct = default)
23+
public async Task<Subject[]> GetSubjectsAsync(string id = "getSubjects", CancellationToken ct = default)
2424
{
2525
List<Subject> subjects = await MakeRequestAsync<object, List<Subject>>(id, "getSubjects", new object(), ct);
2626
return subjects.ToArray();
@@ -36,7 +36,7 @@ public async Task<Subject[]> GetAllSubjectsAsync(string id = "getSubjects", Canc
3636
/// <exception cref="UnauthorizedAccessException">Thrown when you're not logged in</exception>
3737
/// <exception cref="HttpRequestException">Thrown when an error happend while the hppt request</exception>
3838
/// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
39-
public async Task<Class[]> GetAllClassesAsync(string id = "getClasses", CancellationToken ct = default)
39+
public async Task<Class[]> GetClassesAsync(string id = "getClasses", CancellationToken ct = default)
4040
{
4141
List<Class> classes = await MakeRequestAsync<object, List<Class>>(id, "getKlassen", new object(), ct);
4242
return classes.ToArray();
@@ -69,7 +69,7 @@ public async Task<Class[]> GetClassesAsync(SchoolYear schoolYear, string id = "g
6969
/// <exception cref="UnauthorizedAccessException">Thrown when you're not logged in</exception>
7070
/// <exception cref="HttpRequestException">Thrown when an error happend while the http request</exception>
7171
/// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
72-
public async Task<Room[]> GetAllRoomsAsync(string id = "getRooms", CancellationToken ct = default)
72+
public async Task<Room[]> GetRoomsAsync(string id = "getRooms", CancellationToken ct = default)
7373
{
7474
List<Room> rooms = await MakeRequestAsync<object, List<Room>>(id, "getRooms", new object(), ct);
7575
return rooms.ToArray();
@@ -85,7 +85,7 @@ public async Task<Room[]> GetAllRoomsAsync(string id = "getRooms", CancellationT
8585
/// <exception cref="UnauthorizedAccessException">Thrown when you're not logged in</exception>
8686
/// <exception cref="HttpRequestException">Thrown when an error happend while the http request</exception>
8787
/// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
88-
public async Task<Department[]> GetAllDepartmentsAsync(string id = "getDepartments", CancellationToken ct = default)
88+
public async Task<Department[]> GetDepartmentsAsync(string id = "getDepartments", CancellationToken ct = default)
8989
{
9090
List<Department> departments = await MakeRequestAsync<object, List<Department>>(id, "getDepartments", new object(), ct);
9191
return departments.ToArray();

WebUntisAPI.Client/WebUntisClient.TimeTable.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public async Task<Timegrid> GetTimegridAsync(string id = "getTimegrid", Cancella
5252
/// <exception cref="UnauthorizedAccessException">Thrown when you're not logged in</exception>
5353
/// <exception cref="HttpRequestException">Thrown when an error happend while the http request</exception>
5454
/// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
55-
public async Task<SchoolYear[]> GetAllSchoolYearsAsync(string id = "getSchoolyears", CancellationToken ct = default)
55+
public async Task<SchoolYear[]> GetSchoolYearsAsync(string id = "getSchoolyears", CancellationToken ct = default)
5656
{
5757
List<SchoolYear> schoolYears = await MakeRequestAsync<object, List<SchoolYear>>(id, "getSchoolyears", new object(), ct);
5858
return schoolYears.ToArray();
@@ -84,7 +84,7 @@ public async Task<SchoolYear> GetCurrentSchoolYearAsync(string id = "getCurrentS
8484
/// <exception cref="UnauthorizedAccessException">Thrown when you're not logged in</exception>
8585
/// <exception cref="HttpRequestException">Thrown when an error happend while the http request</exception>
8686
/// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
87-
public async Task<Holidays[]> GetAllHolidaysAsync(string id = "getHolidays", CancellationToken ct = default)
87+
public async Task<Holidays[]> GetHolidaysAsync(string id = "getHolidays", CancellationToken ct = default)
8888
{
8989
List<Holidays> holidays = await MakeRequestAsync<object, List<Holidays>>(id, "getHolidays", new object(), ct);
9090
return holidays.ToArray();

WebUntisAPI.Client/WebUntisClient.User.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public partial class WebUntisClient
3838
/// <exception cref="UnauthorizedAccessException">Thrown when you don't logged in</exception>
3939
/// <exception cref="HttpRequestException">Thrown when there was an error while the http request</exception>
4040
/// <exception cref="ObjectDisposedException">Thrown when the object is disposed</exception>
41-
public async Task<Student[]> GetAllStudentsAsync(string id = "getStudents", CancellationToken ct = default)
41+
public async Task<Student[]> GetStudentsAsync(string id = "getStudents", CancellationToken ct = default)
4242
{
4343
List<Student> students = await MakeRequestAsync<object, List<Student>>(id, "getStudents", new object(), ct);
4444
return students.ToArray();
@@ -54,7 +54,7 @@ public async Task<Student[]> GetAllStudentsAsync(string id = "getStudents", Canc
5454
/// <exception cref="HttpRequestException">Thrown when there was an error while the http request</exception>
5555
/// <exception cref="WebUntisException">Thrown when the WebUntis API returned an error</exception>
5656
/// <exception cref="ObjectDisposedException">Thrown when the object is disposed</exception>
57-
public async Task<Teacher[]> GetAllTeachersAsync(string id = "getTeachers", CancellationToken ct = default)
57+
public async Task<Teacher[]> GetTeachersAsync(string id = "getTeachers", CancellationToken ct = default)
5858
{
5959
List<Teacher> teachers = await MakeRequestAsync<object, List<Teacher>>(id, "getTeachers", new object(), ct);
6060
return teachers.ToArray();

WebUntisAPI.Client/WebUntisClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public async Task<bool> LoginAsync(string server, string loginName, string usern
170170

171171
// Get logged in user data
172172
_userType = (UserType)responseModel.Result.PersonType;
173-
IUser[] users = _userType == Client.UserType.Student ? (IUser[])await GetAllStudentsAsync(ct: ct) : await GetAllTeachersAsync(ct: ct);
173+
IUser[] users = _userType == Client.UserType.Student ? (IUser[])await GetStudentsAsync(ct: ct) : await GetTeachersAsync(ct: ct);
174174
_user = users.FirstOrDefault(u => u.Id == responseModel.Result.PersonId);
175175

176176
return true;

0 commit comments

Comments
 (0)