Esempio n. 1
0
        public void EnvironmentInfo_IncorrectEventType(string eventType)
        {
            var client  = new ExceptionlessClient();
            var context = new EventPluginContext(client, new Event {
                Type = eventType
            });

            var plugin = new EnvironmentInfoPlugin();

            plugin.Run(context);
            Assert.Equal(0, context.Event.Data.Count);
        }
Esempio n. 2
0
        public void EnvironmentInfo_ShouldAddSessionStart()
        {
            var client  = new ExceptionlessClient();
            var context = new EventPluginContext(client, new Event {
                Type = Event.KnownTypes.SessionStart
            });

            var plugin = new EnvironmentInfoPlugin();

            plugin.Run(context);
            Assert.Equal(1, context.Event.Data.Count);
            Assert.NotNull(context.Event.Data[Event.KnownDataKeys.EnvironmentInfo]);
        }
Esempio n. 3
0
        public void ShouldAddSessionStart()
        {
            var client  = CreateClient();
            var context = new EventPluginContext(client, new Event {
                Type = Event.KnownTypes.Session
            });

            var plugin = new EnvironmentInfoPlugin();

            plugin.Run(context);
            Assert.Single(context.Event.Data);
            Assert.NotNull(context.Event.Data[Event.KnownDataKeys.EnvironmentInfo]);
        }
        public void EnvironmentInfo_CanRunInParallel()
        {
            var client = CreateClient();
            var ev     = new Event {
                Type = Event.KnownTypes.Session
            };
            var plugin = new EnvironmentInfoPlugin();

            Parallel.For(0, 10000, i => {
                var context = new EventPluginContext(client, ev);
                plugin.Run(context);
                Assert.Equal(1, context.Event.Data.Count);
                Assert.NotNull(context.Event.Data[Event.KnownDataKeys.EnvironmentInfo]);
            });
        }