Skip to content

Commit

Permalink
Extra season properties on events (#48)
Browse files Browse the repository at this point in the history
* Expose more season data on events

* Fixed build

* Version bump
  • Loading branch information
mroloux authored Feb 24, 2022
1 parent 3004dcb commit 3e2c63b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions SeatsioDotNet.Test/Events/RetrieveEventTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public void Test()

Assert.NotNull(retrievedEvent.Key);
Assert.NotEqual(0, retrievedEvent.Id);
Assert.False(retrievedEvent.IsEventInSeason);
Assert.Equal(chartKey, retrievedEvent.ChartKey);
Assert.Equal("INHERIT", evnt.TableBookingConfig.Mode);
Assert.True(retrievedEvent.SupportsBestAvailable);
Expand All @@ -38,6 +39,8 @@ public void RetrieveSeason()

Assert.NotNull(retrievedSeason.Key);
Assert.NotEqual(0, retrievedSeason.Id);
Assert.True(retrievedSeason.IsTopLevelSeason);
Assert.Null(retrievedSeason.TopLevelSeasonKey);
Assert.Equal(new[] {partialSeason1.Key, partialSeason2.Key}, retrievedSeason.PartialSeasonKeys);
Assert.Empty(retrievedSeason.Events);
Assert.Equal(chartKey, season.ChartKey);
Expand Down
2 changes: 1 addition & 1 deletion SeatsioDotNet.Test/ExponentialBackoffTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void AbortsEventuallyIfServerKeepsReturning429()

var duration = DateTimeOffset.Now.ToUnixTimeSeconds() - start.ToUnixTimeSeconds();
Assert.True(duration > 10);
Assert.True(duration < 20);
Assert.True(duration < 30);
}

[Fact]
Expand Down
2 changes: 2 additions & 0 deletions SeatsioDotNet.Test/Seasons/CreateEventsInSeasonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public void EventsKeysCanBePassedIn()
var updatedSeason = Client.Seasons.CreateEvents(season.Key, eventKeys: new[] {"event1", "event2"});

Assert.Equal(new[] {"event1", "event2"}, updatedSeason.Events.Select(e => e.Key));
Assert.True(updatedSeason.Events[0].IsEventInSeason);
Assert.Equal(season.Key, updatedSeason.Events[0].TopLevelSeasonKey);
}

[Fact]
Expand Down
2 changes: 2 additions & 0 deletions SeatsioDotNet.Test/Seasons/CreatePartialSeasonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public void KeyCanBePassedIn()
var partialSeason = Client.Seasons.CreatePartialSeason(topLevelSeason.Key, partialSeasonKey: "aPartialSeason");

Assert.Equal("aPartialSeason", partialSeason.Key);
Assert.True(partialSeason.IsPartialSeason);
Assert.Equal(topLevelSeason.Key, partialSeason.TopLevelSeasonKey);
}

[Fact]
Expand Down
2 changes: 2 additions & 0 deletions SeatsioDotNet.Test/Seasons/CreateSeasonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public void ChartKeyIsMandatory()

Assert.NotNull(season.Key);
Assert.NotEqual(0, season.Id);
Assert.True(season.IsTopLevelSeason);
Assert.Null(season.TopLevelSeasonKey);
Assert.Empty(season.PartialSeasonKeys);
Assert.Empty(season.Events);
Assert.Equal(chartKey, season.ChartKey);
Expand Down
4 changes: 4 additions & 0 deletions SeatsioDotNet/Events/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ public class Event
public List<string> PartialSeasonKeys { get; set; }
public List<Event> Events { get; set; }
public bool IsSeason { get; set; }
public bool IsTopLevelSeason { get; set; }
public bool IsPartialSeason { get; set; }
public bool IsEventInSeason { get; set; }
public string TopLevelSeasonKey { get; set; }
}
}
2 changes: 1 addition & 1 deletion SeatsioDotNet/SeatsioDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<IsPackable>true</IsPackable>
<Version>85.0.0</Version>
<Version>85.1.0</Version>
<Authors>mroloux;bverbeken</Authors>
<Title>Official Seats.io .NET API client</Title>
<Description>Official Seats.io .NET API client</Description>
Expand Down

0 comments on commit 3e2c63b

Please sign in to comment.