Esempio n. 1
0
 public async Task CanPublishCustomEvent()
 {
     EventGridPublisherClientOptions options = Recording.InstrumentClientOptions(new EventGridPublisherClientOptions());
     EventGridPublisherClient        client  = InstrumentClient(
         new EventGridPublisherClient(
             new Uri(TestEnvironment.CustomEventTopicHost),
             new AzureKeyCredential(TestEnvironment.CustomEventTopicKey),
             options));
     await client.PublishCustomEventsAsync(GetCustomEventsList());
 }
Esempio n. 2
0
        public async Task CustomizeSerializedJSONPropertiesToCamelCase()
        {
            EventGridPublisherClientOptions options = Recording.InstrumentClientOptions(new EventGridPublisherClientOptions());

            options.Serializer = new JsonObjectSerializer(
                new JsonSerializerOptions()
            {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            });

            EventGridPublisherClient client = InstrumentClient(
                new EventGridPublisherClient(
                    new Uri(TestEnvironment.CustomEventTopicHost),
                    new AzureKeyCredential(TestEnvironment.CustomEventTopicKey),
                    options));
            await client.PublishCustomEventsAsync(GetCustomEventsList());
        }