diff --git a/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs b/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs index 188a321..ee20310 100644 --- a/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs +++ b/SeatsioDotNet.Test/Events/ChangeBestAvailableObjectStatusTest.cs @@ -68,14 +68,29 @@ public void ExtraData() new Dictionary {{"foo", "baz"}} }; - var bestAvailableResult = - Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(2, null, extraData), "foo"); + var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(2, extraData: extraData), "foo"); Assert.Equal(new[] {"B-4", "B-5"}, bestAvailableResult.Objects); - Assert.Equal(new Dictionary {{"foo", "bar"}}, - Client.Events.RetrieveObjectStatus(evnt.Key, "B-4").ExtraData); - Assert.Equal(new Dictionary {{"foo", "baz"}}, - Client.Events.RetrieveObjectStatus(evnt.Key, "B-5").ExtraData); + Assert.Equal(new Dictionary {{"foo", "bar"}}, Client.Events.RetrieveObjectStatus(evnt.Key, "B-4").ExtraData); + Assert.Equal(new Dictionary {{"foo", "baz"}}, Client.Events.RetrieveObjectStatus(evnt.Key, "B-5").ExtraData); + } + + [Fact] + public void TicketTypes() + { + var chartKey = CreateTestChart(); + var evnt = Client.Events.Create(chartKey); + var extraData = new[] + { + new Dictionary {{"foo", "bar"}}, + new Dictionary {{"foo", "baz"}} + }; + + var bestAvailableResult = Client.Events.ChangeObjectStatus(evnt.Key, new BestAvailable(2, ticketTypes: new[]{"adult", "child"}), "foo"); + + Assert.Equal(new[] {"B-4", "B-5"}, bestAvailableResult.Objects); + Assert.Equal("adult", Client.Events.RetrieveObjectStatus(evnt.Key, "B-4").TicketType); + Assert.Equal("child", Client.Events.RetrieveObjectStatus(evnt.Key, "B-5").TicketType); } [Fact] diff --git a/SeatsioDotNet/Events/BestAvailable.cs b/SeatsioDotNet/Events/BestAvailable.cs index 2024436..cbd8710 100644 --- a/SeatsioDotNet/Events/BestAvailable.cs +++ b/SeatsioDotNet/Events/BestAvailable.cs @@ -7,23 +7,14 @@ public class BestAvailable public int Number { get; } public IEnumerable Categories { get; } public IEnumerable> ExtraData { get; } + public string[] TicketTypes { get; } - public BestAvailable(int number) - { - Number = number; - } - - public BestAvailable(int number, IEnumerable categories) - { - Categories = categories; - Number = number; - } - - public BestAvailable(int number, IEnumerable categories, IEnumerable> extraData) + public BestAvailable(int number, IEnumerable categories = null, IEnumerable> extraData = null, string[] ticketTypes = null) { Categories = categories; Number = number; ExtraData = extraData; + TicketTypes = ticketTypes; } public Dictionary AsDictionary() @@ -36,11 +27,14 @@ public Dictionary AsDictionary() { dictionary.Add("categories", Categories); } - if (ExtraData != null) { dictionary.Add("extraData", ExtraData); } + if (TicketTypes != null) + { + dictionary.Add("ticketTypes", TicketTypes); + } return dictionary; } diff --git a/SeatsioDotNet/SeatsioDotNet.csproj b/SeatsioDotNet/SeatsioDotNet.csproj index 8138dd7..52606ca 100644 --- a/SeatsioDotNet/SeatsioDotNet.csproj +++ b/SeatsioDotNet/SeatsioDotNet.csproj @@ -2,7 +2,7 @@ Library true - 70.12.0 + 70.13.0 mroloux;bverbeken Official Seats.io .NET API client Official Seats.io .NET API client