From d2c23a6f1c5ddd1d55c0710c2c5d7bd1997c9a3a Mon Sep 17 00:00:00 2001 From: Louis Zanella Date: Fri, 20 Dec 2024 12:17:32 -0500 Subject: [PATCH] review --- NGitLab.Tests/EventTests.cs | 7 +++++-- NGitLab/Models/EventAction.cs | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/NGitLab.Tests/EventTests.cs b/NGitLab.Tests/EventTests.cs index 853d1024..cef7af6a 100644 --- a/NGitLab.Tests/EventTests.cs +++ b/NGitLab.Tests/EventTests.cs @@ -72,10 +72,13 @@ public async Task Test_get_events_of_specific_action_type() var userEventClient = context.Client.GetUserEvents(currentUserId); // Act - var closedEvents = userEventClient.Get(new EventQuery { Action = EventAction.Closed }); - var issueClosedEvent = closedEvents.SingleOrDefault(e => string.Equals(e.TargetTitle, issueTitle)); + var closedEvents = userEventClient.Get(new EventQuery { Action = EventAction.Closed }).ToArray(); // Assert + Assert.That(closedEvents.All(e => e.Action.EnumValue is EventAction.Closed), Is.True); + + var issueClosedEvent = closedEvents.SingleOrDefault(e => string.Equals(e.TargetTitle, issueTitle, StringComparison.Ordinal)); Assert.That(issueClosedEvent, Is.Not.Null); + Assert.That(issueClosedEvent.TargetType.EnumValue, Is.EqualTo(EventTargetType.Issue)); } } diff --git a/NGitLab/Models/EventAction.cs b/NGitLab/Models/EventAction.cs index 872691e5..bd76e2f9 100644 --- a/NGitLab/Models/EventAction.cs +++ b/NGitLab/Models/EventAction.cs @@ -4,6 +4,7 @@ namespace NGitLab.Models; public enum EventAction { + [EnumMember(Value = "accepted")] Accepted, [EnumMember(Value = "approved")] Approved, @@ -11,10 +12,13 @@ public enum EventAction Created, [EnumMember(Value = "updated")] Updated, + [EnumMember(Value = "uploaded")] Uploaded, + [EnumMember(Value = "deleted")] Deleted, [EnumMember(Value = "closed")] Closed, + [EnumMember(Value = "opened")] Opened, [EnumMember(Value = "reopened")] Reopened,