public void UpsertStandardAttributeByTitle_Successful()
        {
            var sourceAttribute = service.GetStandardAttributes().First();

            var updatedAttribute = service.UpsertStandardAttributeByTitle(sourceAttribute);

            AssertExtension.AreObjectsValuesEqual(sourceAttribute, updatedAttribute);
        }
Example #2
0
        private static void TestUpdateStandardAttributeByTitle(VenueServiceApi venueServiceApi, IList <StandardAttribute> standardAttributes)
        {
            Console.WriteLine();
            Console.WriteLine(" ========================================================== ");
            Console.WriteLine(" Test: Update standard attribute by title ");
            Console.WriteLine(" ========================================================== ");
            var sourceAttribute  = standardAttributes.First();
            var updatedAttribute = venueServiceApi.UpsertStandardAttributeByTitle(sourceAttribute);

            Console.WriteLine($"{updatedAttribute?.title} - {updatedAttribute?.intention}");
        }
        public void UpsertStandardAttributeByTitle_IfContextUnauthorized_Exception401()
        {
            var sourceAttribute = new Attribute {
                Title = "test"
            };

            service = new VenueServiceApi(context);

            var exception = Assert.Catch <ApiException>(() =>
            {
                var updatedAttribute = service.UpsertStandardAttributeByTitle(sourceAttribute);
            });

            AssertApiException(exception, HttpStatusCode.Unauthorized);
        }
        public void UpsertStandardAttributeByTitle_IfTokenInvalid_Exception403()
        {
            var sourceAttribute = new Attribute {
                Title = "test"
            };

            context.AccessToken = "invalid_token";
            service             = new VenueServiceApi(context);

            var exception = Assert.Catch <ApiException>(() =>
            {
                var updatedAttribute = service.UpsertStandardAttributeByTitle(sourceAttribute);
            });

            AssertApiException(exception, HttpStatusCode.Forbidden);
        }