Пример #1
0
        public async Task When_SendAsync_Then_CorrectDataSent()
        {
            bool result = await Client.SendJsonAsync(MixpanelMessageEndpoint.Track, CreateJsonMessage());

            Assert.That(result, Is.True);
            Assert.That(HttpPostEntries.Single().Endpoint, Is.EqualTo(TrackUrl));
            CheckSendJsonMessage();
        }
Пример #2
0
        private void AssertSentData(object expectedDistinctId)
        {
            var(endpoint, data) = HttpPostEntries.Single();

            Assert.That(endpoint, Is.EqualTo(EngageUrl));

            var msg = ParseMessageData(data);

            AssertJson(msg, expectedDistinctId);
        }
Пример #3
0
        private void CheckSendJsonMessage()
        {
            var msg = ParseMessageData(HttpPostEntries.Single().Data);

            Assert.That(msg.Count, Is.EqualTo(2));
            Assert.That(msg["event"].Value <string>(), Is.EqualTo(Event));
            var props = (JObject)msg["properties"];

            Assert.That(props.Count, Is.EqualTo(3));
            Assert.That(props["token"].Value <string>(), Is.EqualTo(Token));
            Assert.That(props["distinct_id"].Value <string>(), Is.EqualTo(DistinctId));
            Assert.That(props[StringPropertyName].Value <string>(), Is.EqualTo(StringPropertyValue));
        }