Skip to content

Commit

Permalink
Entrance is returned when changing object status
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux committed Jun 26, 2018
1 parent fcce771 commit 61e979b
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 4 deletions.
20 changes: 20 additions & 0 deletions SeatsioDotNet.Test/Events/BookObjectsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@ public void Test()
{"A-2", new Labels("2", "seat", "A", "row")}
});
}


[Fact]
public void Sections()
{
var chartKey = CreateTestChartWithSections();
var evnt = Client.Events.Create(chartKey);

var result = Client.Events.Book(evnt.Key, new[] {"Section A-A-1", "Section A-A-2"});

Assert.Equal(ObjectStatus.Booked, Client.Events.RetrieveObjectStatus(evnt.Key, "Section A-A-1").Status);
Assert.Equal(ObjectStatus.Booked, Client.Events.RetrieveObjectStatus(evnt.Key, "Section A-A-2").Status);
Assert.Equal(ObjectStatus.Free, Client.Events.RetrieveObjectStatus(evnt.Key, "Section A-A-3").Status);

result.Labels.Should().BeEquivalentTo(new Dictionary<string, Labels>
{
{"Section A-A-1", new Labels("1", "seat", "A", "row", "Section A", "Entrance 1")},
{"Section A-A-2", new Labels("2", "seat", "A", "row", "Section A", "Entrance 1")}
});
}

[Fact]
public void HoldToken()
Expand Down
18 changes: 16 additions & 2 deletions SeatsioDotNet.Test/SeatsioClientTest.cs

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions SeatsioDotNet/Events/Entrance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace SeatsioDotNet.Events
{
public class Entrance
{
public string Label { get; set; }

public Entrance()
{
}

public Entrance(string label = null)
{
Label = label;
}
}
}
8 changes: 7 additions & 1 deletion SeatsioDotNet/Events/Labels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@ public class Labels
public LabelAndType Own { get; set; }
public LabelAndType Parent { get; set; }
public string Section { get; set; }
public Entrance Entrance { get; set; }

public Labels()
{
}

public Labels(string ownLabel = null, string ownType = null, string parentLabel = null, string parentType = null, string section = null)
public Labels(string ownLabel = null, string ownType = null, string parentLabel = null, string parentType = null, string section = null, string entrance = null)
{
Own = new LabelAndType(ownLabel, ownType);
if (parentLabel != null)
{
Parent = new LabelAndType(parentLabel, parentType);
}

if (entrance != null)
{
Entrance = new Entrance(entrance);
}

Section = section;
}

Expand Down
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>28</Version>
<Version>29</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 61e979b

Please sign in to comment.