Exemplo n.º 1
0
        public void GetVenueById_Successful()
        {
            var venueId = configuration["Venue:TestVenueIdWithSeatAttributes"];

            var venue = service.GetVenueById(venueId);

            AssertVenueHasDetails(venue);
        }
Exemplo n.º 2
0
        private static Venue TestGetVenueById(VenueServiceApi venueServiceApi, string venueId)
        {
            Console.WriteLine();
            Console.WriteLine(" ========================================================== ");
            Console.WriteLine($" Test: Get detailed venue by ID = {venueId} ");
            Console.WriteLine(" ========================================================== ");
            var venue = venueServiceApi.GetVenueById(venueId);

            Console.WriteLine($"{venue.title} ({venue.internalId}): {venue.compositeId}");
            return(venue);
        }
Exemplo n.º 3
0
        public void UpdateVenue_IfContextUnauthorized_Exception401()
        {
            var venueId = configuration["Venue:TestVenueIdWithAddress"];

            service = new VenueServiceApi(context);
            var sourceVenue = service.GetVenueById(venueId);

            var exception = Assert.Catch <ApiException>(() =>
            {
                var updatedVenue = service.UpdateVenueById(sourceVenue);
            });

            AssertApiException(exception, HttpStatusCode.Unauthorized);
        }
Exemplo n.º 4
0
        public void UpdateVenue_IfTokenInvalid_Exception403()
        {
            var venueId = configuration["Venue:TestVenueIdWithAddress"];

            context.AccessToken = "invalid_token";
            service             = new VenueServiceApi(context);
            var sourceVenue = service.GetVenueById(venueId);

            var exception = Assert.Catch <ApiException>(() =>
            {
                var updatedVenue = service.UpdateVenueById(sourceVenue);
            });

            AssertApiException(exception, HttpStatusCode.Forbidden);
        }