本文整理汇总了C#中Tracker.TrackUnstructEvent方法的典型用法代码示例。如果您正苦于以下问题:C# Tracker.TrackUnstructEvent方法的具体用法?C# Tracker.TrackUnstructEvent怎么用?C# Tracker.TrackUnstructEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker
的用法示例。
在下文中一共展示了Tracker.TrackUnstructEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testTrackUnstructEventBase64
public void testTrackUnstructEventBase64()
{
using (Microsoft.QualityTools.Testing.Fakes.ShimsContext.Create())
{
ShimHttpWebRequest.AllInstances.GetResponse = fake;
var t = new Tracker(new Emitter("d3rkrsqld9gmqf.cloudfront.net"));
var eventJson = new Dictionary<string, object>
{
{"schema", "iglu:com.acme/test/jsonschema/1-0-0"},
{"data", new Dictionary<string, string>
{
{ "page", "testpage" },
{ "user", "tester" }
}
}
};
t.TrackUnstructEvent(eventJson);
var expected = new Dictionary<string, string>
{
{"e", "ue"}
};
checkResult(expected, payloads[payloads.Count - 1]);
var expectedJsonString = @"{""schema"":""iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0"",""data"":{""schema"":""iglu:com.acme/test/jsonschema/1-0-0"",""data"":{""page"":""testpage"",""user"":""tester""}}}";
byte[] data = Convert.FromBase64String(payloads[payloads.Count - 1]["ue_px"]);
string actualJsonString = Encoding.UTF8.GetString(data);
Assert.AreEqual(expectedJsonString, actualJsonString);
}
}