Skip to content

Commit f63c6e5

Browse files
committed
Add some debugger display attributes, Set the request timeout up to 1000ms
1 parent bddf57b commit f63c6e5

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

API.Test/AuthentificationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace API.Test;
1111
[TestFixture]
1212
internal class AuthentificationTests
1313
{
14-
public static WebUntisClient Client { get; set; } = new("WebUntisAPI_TEST");
14+
public static WebUntisClient Client { get; set; } = new("WebUntisAPI_TEST", 1000);
1515

1616
static AuthentificationTests()
1717
{

API.Test/TimeTableTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public void GetTimetable()
8282
{
8383
Client.LoginAsync(s_Server, s_LoginName, s_UserName, s_Password).Wait();
8484

85-
Task<Period[]> timetable = Client.GetTimetableForStudentAsync(Client.User as Student, new DateTime(2023, 05, 29), new DateTime(2023, 06, 2));
85+
Task<Period[]> timetable = Client.GetTimetableForStudentAsync(Client.User as Student, new DateTime(2023, 05, 29), new DateTime(2023, 09, 2));
8686
timetable.Wait();
8787
if (timetable.Result.Length > 0)
8888
Assert.Pass();

WebUntisAPI.Client/Models/ObjectId.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace WebUntisAPI.Client.Models
1212
/// <summary>
1313
/// The id of an object and when its irregular the original id and the current id
1414
/// </summary>
15+
[DebuggerDisplay("{ToString(), nq}")]
1516
public struct ObjectId
1617
{
1718
/// <summary>
@@ -26,6 +27,14 @@ public struct ObjectId
2627
[DefaultValue(null)]
2728
[JsonProperty("orgid")]
2829
public int? OriginalId { get; set; }
30+
31+
/// <inheritdoc/>
32+
public override string ToString()
33+
{
34+
if (OriginalId is int orgId)
35+
return Id.ToString() + " " + "(" + orgId + ")";
36+
else
37+
return Id.ToString();
38+
}
2939
}
3040
}
31-

WebUntisAPI.Client/Models/Period.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,28 @@ public class Period
5858
/// Ids of all involved teachers
5959
/// </summary>
6060
[JsonProperty("te")]
61+
[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
6162
public ObjectId[] TeacherIds { get; set; }
6263

6364
/// <summary>
6465
/// Ids of all involved subjects
6566
/// </summary>
6667
[JsonProperty("su")]
68+
[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
6769
public ObjectId[] SubjectsIds { get; set; }
6870

6971
/// <summary>
7072
/// Ids of all involved room
7173
/// </summary>
7274
[JsonProperty("ro")]
75+
[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
7376
public ObjectId[] RoomIds { get; set; }
7477

7578
/// <summary>
7679
/// The type of tghe lesson
7780
/// </summary>
7881
[JsonProperty("lstype")]
82+
[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
7983
public LessonType LessonType { get; set; } = LessonType.Ls;
8084

8185
/// <summary>

0 commit comments

Comments
 (0)