diff --git a/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs b/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs index c7859b3..3560a5d 100644 --- a/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs +++ b/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs @@ -188,4 +188,16 @@ public async Task IgnoreChannels() Assert.Equal(new[] {"A-5"}, bestAvailableResult.Objects); } + + [Fact] + public async Task AccessibleSeats() + { + var chartKey = CreateTestChart(); + var evnt = await Client.Events.CreateAsync(chartKey); + + var bestAvailableResult = await Client.Events.ChangeObjectStatusAsync(evnt.Key, new BestAvailable(3, accessibleSeats: 1), "foo"); + + Assert.True(bestAvailableResult.NextToEachOther); + Assert.Equal(new[] {"A-6", "A-7", "A-8"}, bestAvailableResult.Objects); + } } \ No newline at end of file diff --git a/SeatsioDotNet.Test/resources/sampleChart.json b/SeatsioDotNet.Test/resources/sampleChart.json index 5c7944b..2e06da5 100644 --- a/SeatsioDotNet.Test/resources/sampleChart.json +++ b/SeatsioDotNet.Test/resources/sampleChart.json @@ -150,7 +150,7 @@ "categoryAccessible": false, "categoryKey": 9, "restrictedView": false, - "accessible": false, + "accessible": true, "companionSeat": false, "disabledBySocialDistancingRules": false, "uuid": "uuid294", diff --git a/SeatsioDotNet/Events/BestAvailable.cs b/SeatsioDotNet/Events/BestAvailable.cs index e16c636..fff4e21 100644 --- a/SeatsioDotNet/Events/BestAvailable.cs +++ b/SeatsioDotNet/Events/BestAvailable.cs @@ -10,8 +10,10 @@ public class BestAvailable public IEnumerable> ExtraData { get; } public string[] TicketTypes { get; } public bool? TryToPreventOrphanSeats; + public int? AccessibleSeats; - public BestAvailable(int number, IEnumerable categories = null, IEnumerable> extraData = null, string[] ticketTypes = null, bool? tryToPreventOrphanSeats = null, string zone = null) + public BestAvailable(int number, IEnumerable categories = null, IEnumerable> extraData = null, + string[] ticketTypes = null, bool? tryToPreventOrphanSeats = null, string zone = null, int? accessibleSeats = null) { Categories = categories; Number = number; @@ -19,6 +21,7 @@ public BestAvailable(int number, IEnumerable categories = null, IEnumera TicketTypes = ticketTypes; TryToPreventOrphanSeats = tryToPreventOrphanSeats; Zone = zone; + AccessibleSeats = accessibleSeats; } public Dictionary AsDictionary() @@ -53,6 +56,11 @@ public Dictionary AsDictionary() dictionary.Add("tryToPreventOrphanSeats", TryToPreventOrphanSeats); } + if (AccessibleSeats != null) + { + dictionary.Add("accessibleSeats", AccessibleSeats); + } + return dictionary; } } \ No newline at end of file