Skip to content

Commit

Permalink
Expose NumNotForSale in EventObjectInfo (#123)
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Chaloner <[email protected]>
  • Loading branch information
schaloner and Steve Chaloner authored Jun 7, 2024
1 parent 57badd3 commit f2d19c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions SeatsioDotNet.Test/Events/MarkObjectsAsNotForSaleTest.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Threading.Tasks;
using SeatsioDotNet.EventReports;
using Xunit;

namespace SeatsioDotNet.Test.Events;

public class MarkObjectsAsNotForSaleTest : SeatsioClientTest
{
[Fact]
public async Task ObjectsCandCategories()
public async Task ObjectsAndCategories()
{
var chartKey = CreateTestChart();
var evnt = await Client.Events.CreateAsync(chartKey);
Expand Down Expand Up @@ -46,4 +48,15 @@ public async Task Categories()
Assert.Empty(forSaleConfig.AreaPlaces);
Assert.Equal(new[] {"cat1", "cat2"}, forSaleConfig.Categories);
}

[Fact]
public async Task NumNotForSaleIsCorrectlyExposed()
{
var chartKey = CreateTestChart();
var evnt = await Client.Events.CreateAsync(chartKey);
await Client.Events.MarkAsNotForSaleAsync(evnt.Key, null, new() {{"GA1", 3}}, null);

Dictionary<string,EventObjectInfo> info = await Client.Events.RetrieveObjectInfosAsync(evnt.Key, new[] { "GA1" });
Assert.Equal(3, info["GA1"].NumNotForSale);
}
}
1 change: 1 addition & 0 deletions SeatsioDotNet/Events/EventObjectInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class EventObjectInfo
public int? NumBooked { get; set; }
public int? NumFree { get; set; }
public int? NumHeld { get; set; }
public int? NumNotForSale { get; set; }
public int? Capacity { get; set; }
public bool? BookAsAWhole { get; set; }
public Dictionary<string, object> ExtraData { get; set; }
Expand Down

0 comments on commit f2d19c1

Please sign in to comment.