Exemplo n.º 1
0
        public void WillRespectIncludeUserName()
        {
            var client = CreateClient(c => c.IncludeUserName = false);
            var plugin = new SetEnvironmentUserPlugin();

            var context = new EventPluginContext(client, new Event {
                Type = Event.KnownTypes.Log, Message = "test"
            });

            plugin.Run(context);

            Assert.Null(context.Event.GetUserIdentity());
        }
        public void PrivateInformation_WillSetIdentity()
        {
            var client = CreateClient();
            var plugin = new SetEnvironmentUserPlugin();

            var context = new EventPluginContext(client, new Event {
                Type = Event.KnownTypes.Log, Message = "test"
            });

            plugin.Run(context);

            var user = context.Event.GetUserIdentity();

            Assert.Equal(Environment.UserName, user.Identity);
        }
        public void PrivateInformation_WillNotUpdateIdentity()
        {
            var client = CreateClient();
            var plugin = new SetEnvironmentUserPlugin();

            var ev = new Event {
                Type = Event.KnownTypes.Log, Message = "test"
            };

            ev.SetUserIdentity(null, "Blake");
            var context = new EventPluginContext(client, ev);

            plugin.Run(context);

            var user = context.Event.GetUserIdentity();

            Assert.Null(user.Identity);
            Assert.Equal("Blake", user.Name);
        }
        public void PrivateInformation_WillNotUpdateIdentity() {
            var client = new ExceptionlessClient();
            var plugin = new SetEnvironmentUserPlugin();

            var ev = new Event { Type = Event.KnownTypes.Log, Message = "test" };
            ev.SetUserIdentity(null, "Blake");
            var context = new EventPluginContext(client, ev);
            plugin.Run(context);

            var user = context.Event.GetUserIdentity();
            Assert.Null(user.Identity);
            Assert.Equal("Blake", user.Name);
        }
        public void PrivateInformation_WillSetIdentity() {
            var client = new ExceptionlessClient();
            var plugin = new SetEnvironmentUserPlugin();

            var context = new EventPluginContext(client, new Event { Type = Event.KnownTypes.Log, Message = "test" });
            plugin.Run(context);

            var user = context.Event.GetUserIdentity();
            Assert.Equal(Environment.UserName, user.Identity);
        }