Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Microsoft.Azure.ApplicationInsights.Query.Models
{
public partial class EventsResultDataCustomDimensions
{
#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value
[JsonExtensionData]
private IDictionary<string, JToken> _customDimensionsValues;
#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value

public IEnumerable<string> Keys => _customDimensionsValues?.Keys;

public bool TryGetValue(string key, out string value)
{
if (_customDimensionsValues != null && _customDimensionsValues.TryGetValue(key, out var jToken))
{
value = jToken?.ToString();
return true;
}
value = null;
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ protected void AssertEvent(EventsResultData evnt, string expectedType)

Assert.NotNull(evnt.Timestamp);
// CustomDimensions & CustomMeasurements can be null
if (evnt.CustomDimensions != null && evnt.CustomDimensions.TryGetValue("ProcessId", out var value)) {
Assert.NotNull(value);
}

// Operation
if (expectedType != EventType.CustomEvents && expectedType != EventType.PageViews &&
Expand Down