private void AssertDictionary(IDictionary <string, object> dic, object expectedDistinctId, int propsCount) { AssertDictionarySpecialProperties(dic, expectedDistinctId); var props = (Dictionary <string, object>)dic["properties"]; Assert.That(props.Count, Is.EqualTo(propsCount)); Assert.That(props[StringPropertyName], Is.EqualTo(StringPropertyValue)); Assert.That(props[DecimalPropertyName], Is.EqualTo(DecimalPropertyValue)); if (SuperPropsDetails?.HasFlag(TrackSuperPropsDetails.UserProperties) ?? false) { Assert.That(props[DecimalSuperPropertyName], Is.EqualTo(DecimalSuperPropertyValue)); Assert.That(props[StringSuperPropertyName], Is.EqualTo(StringSuperPropertyValue)); } }
private void AssertJson(JObject msg, object expectedDistinctId, int propsCount) { AssertJsonSpecialProperties(msg, expectedDistinctId); var props = (JObject)msg["properties"]; Assert.That(props.Count, Is.EqualTo(propsCount)); Assert.That(props[StringPropertyName].Value <string>(), Is.EqualTo(StringPropertyValue)); Assert.That(props[DecimalPropertyName].Value <decimal>(), Is.EqualTo(DecimalPropertyValue)); if (SuperPropsDetails?.HasFlag(TrackSuperPropsDetails.UserProperties) ?? false) { Assert.That( props[DecimalSuperPropertyName].Value <decimal>(), Is.EqualTo(DecimalSuperPropertyValue)); Assert.That( props[StringSuperPropertyName].Value <string>(), Is.EqualTo(StringSuperPropertyValue)); } }