public async Task RaiseErrorShouldBeSuccessful() { IEventDestination target = new DogEvents(_testApiKey); HoundEvent data = GetTestEvent(); HoundResult eventResponse = await target.Publish(data); eventResponse.IsSuccess.ShouldBeTrue(); }
internal static HttpContent GetHttpContent(HoundEvent houndEvent) { var eventRequest = new EventRequest { AggregationKey = houndEvent.AggregationKey, AlertType = HoundEventTypeMapper.GetString(houndEvent.AlertType), Host = houndEvent.Host, SourceTypeName = houndEvent.SourceTypeName, Text = houndEvent.Text, Title = houndEvent.Title, Tags = houndEvent.Tags }; HttpContent content = new StringContent(JsonConvert.SerializeObject(eventRequest)); content.Headers.Remove("Content-type"); content.Headers.Add("Content-type", "application/json"); return(content); }