Пример #1
0
        public async Task TestLogEventAsync()
        {
            await ExecuteOnUIThread(async() =>
            {
                await MParticle.StartAsync
                (
                    MParticleOptions.Builder("foo", "bar").Build()
                );
            });


            CustomEvent customEvent = CustomEvent.Builder("foo").Build();

            MParticle.Instance.LogEvent(customEvent);
        }
Пример #2
0
        public void TestCreateEvent()
        {
            CustomEvent customEvent = CustomEvent.Builder("foo").Build();

            Assert.AreEqual("foo", customEvent.EventName);
            Assert.AreEqual(CustomEventType.Other, customEvent.EventType);

            customEvent = CustomEvent.Builder("foo").Type(CustomEventType.Search).Build();
            Assert.AreEqual("foo", customEvent.EventName);
            Assert.AreEqual(CustomEventType.Search, customEvent.EventType);

            Exception e = null;

            try
            {
                customEvent = CustomEvent.Builder(null).Build();
            }
            catch (Exception ex)
            {
                e = ex;
            }
            Assert.IsNotNull(e);
            Assert.AreEqual(typeof(ArgumentException), e.GetType());
        }