예제 #1
0
        public void PropertiesOfStatusChange()
        {
            var chartKey  = CreateTestChart();
            var evnt      = Client.Events.Create(chartKey);
            var extraData = new Dictionary <string, object> {
                { "foo", "bar" }
            };

            Client.Events.ChangeObjectStatus(evnt.Key, new[] { new ObjectProperties("A-1", extraData) }, "s1", null,
                                             "order1");

            var statusChanges = Client.Events.StatusChanges(evnt.Key).All();
            var statusChange  = statusChanges.First();

            Assert.NotEqual(0, statusChange.Id);
            CustomAssert.CloseTo(DateTimeOffset.Now, statusChange.Date);
            Assert.Equal("order1", statusChange.OrderId);
            Assert.Equal("s1", statusChange.Status);
            Assert.Equal("A-1", statusChange.ObjectLabel);
            Assert.Equal(evnt.Id, statusChange.EventId);
            Assert.Equal(extraData, statusChange.ExtraData);
            Assert.Equal("API_CALL", statusChange.Origin.Type);
            Assert.NotNull(statusChange.Origin.Ip);
            Assert.True(statusChange.IsPresentOnChart);
            Assert.Null(statusChange.NotPresentOnChartReason);
        }
예제 #2
0
        public void Test()
        {
            var holdToken = Client.HoldTokens.Create();

            Assert.NotNull(holdToken.Token);
            CustomAssert.CloseTo(DateTimeOffset.Now.AddMinutes(15), holdToken.ExpiresAt);
            Assert.InRange(holdToken.ExpiresInSeconds, 14 * 60, 15 * 60);
        }
예제 #3
0
        public void Test()
        {
            var holdToken = Client.HoldTokens.Create();

            var updatedHoldToken = Client.HoldTokens.ExpiresInMinutes(holdToken.Token, 30);

            Assert.Equal(updatedHoldToken.Token, holdToken.Token);
            CustomAssert.CloseTo(DateTimeOffset.Now.AddMinutes(30), updatedHoldToken.ExpiresAt);
            Assert.InRange(updatedHoldToken.ExpiresInSeconds, 29 * 60, 30 * 60);
        }
예제 #4
0
        public void UpdateChartKey()
        {
            var chartKey1 = CreateTestChart();
            var chartKey2 = CreateTestChart();
            var evnt      = Client.Events.Create(chartKey1);

            Client.Events.Update(evnt.Key, chartKey2, null);

            var retrievedEvent = Client.Events.Retrieve(evnt.Key);

            Assert.Equal(evnt.Key, retrievedEvent.Key);
            Assert.Equal(chartKey2, retrievedEvent.ChartKey);
            CustomAssert.CloseTo(DateTimeOffset.Now, retrievedEvent.UpdatedOn.Value);
        }
예제 #5
0
        public void ChartKeyIsMandatory()
        {
            var chartKey = CreateTestChart();

            var evnt = Client.Events.Create(chartKey);

            Assert.NotNull(evnt.Key);
            Assert.NotEqual(0, evnt.Id);
            Assert.Equal(chartKey, evnt.ChartKey);
            Assert.Equal("INHERIT", evnt.TableBookingConfig.Mode);
            Assert.True(evnt.SupportsBestAvailable);
            Assert.Null(evnt.ForSaleConfig);
            CustomAssert.CloseTo(DateTimeOffset.Now, evnt.CreatedOn.Value);
            Assert.Null(evnt.UpdatedOn);
        }
예제 #6
0
        public void Test()
        {
            var chartKey = CreateTestChart();
            var evnt     = Client.Events.Create(chartKey);

            var retrievedEvent = Client.Events.Retrieve(evnt.Key);

            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);
            Assert.Null(retrievedEvent.ForSaleConfig);
            CustomAssert.CloseTo(DateTimeOffset.Now, retrievedEvent.CreatedOn.Value);
            Assert.Null(retrievedEvent.UpdatedOn);
            Assert.Equal(3, retrievedEvent.Categories.Count);
        }
예제 #7
0
        public void ChartKeyIsMandatory()
        {
            var chartKey = CreateTestChart();

            var season = Client.Seasons.Create(chartKey);

            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);
            Assert.Equal("INHERIT", season.TableBookingConfig.Mode);
            Assert.True(season.SupportsBestAvailable);
            Assert.Null(season.ForSaleConfig);
            CustomAssert.CloseTo(DateTimeOffset.Now, season.CreatedOn.Value);
            Assert.Null(season.UpdatedOn);
        }
예제 #8
0
        public void Test()
        {
            var chartKey = CreateTestChart();

            var season         = Client.Seasons.Create(chartKey);
            var partialSeason1 = Client.Seasons.CreatePartialSeason(season.Key);
            var partialSeason2 = Client.Seasons.CreatePartialSeason(season.Key);

            var retrievedSeason = Client.Seasons.Retrieve(season.Key);

            Assert.NotNull(retrievedSeason.Key);
            Assert.NotEqual(0, retrievedSeason.Id);
            Assert.Equal(new[] { partialSeason1.Key, partialSeason2.Key }, retrievedSeason.PartialSeasonKeys);
            Assert.Empty(retrievedSeason.Events);
            Assert.Equal(chartKey, season.ChartKey);
            Assert.Equal("INHERIT", season.TableBookingConfig.Mode);
            Assert.True(season.SupportsBestAvailable);
            Assert.Null(season.ForSaleConfig);
            CustomAssert.CloseTo(DateTimeOffset.Now, season.CreatedOn.Value);
            Assert.Null(season.UpdatedOn);
        }