Exemplo n.º 1
0
        public void EventLinksAreGenerated(string seqBaseUrl, string eventId, string expectedLink)
        {
            var actual = SeqEvents.UILinkTo(
                seqBaseUrl,
                new Event <LogEventData>(eventId, 0, DateTime.UtcNow, new LogEventData()));

            Assert.Equal(expectedLink, actual);
        }
Exemplo n.º 2
0
        public void CorrectOpenLinkTitleIsIdentified(uint eventType, string expectedLinkTitle)
        {
            var(title, _) = SeqEvents.GetOpenLink(
                "https://example.com",
                new Event <LogEventData>("event-1", eventType, DateTime.UtcNow, new LogEventData()));

            Assert.Equal(title, expectedLinkTitle);
        }
Exemplo n.º 3
0
        public void PropertiesAreRetrievedFromTheEvent(string propertyPath, string expectedMarkdown)
        {
            var data = new LogEventData
            {
                Properties = new Dictionary <string, object>
                {
                    ["First"]  = null,
                    ["Second"] = 20,
                    ["Third"]  = new Dictionary <string, object>
                    {
                        ["Fourth"] = "test 1",
                        ["Fifth"]  = new Dictionary <string, object>
                        {
                            ["Sixth"]   = "test 2",
                            ["Seventh"] = 123
                        }
                    },
                    ["Eighth"] = new Dictionary <string, object>
                    {
                        ["Excluded"] = true
                    }
                }
            };

            var evt    = new Event <LogEventData>("event-123", 4, DateTime.UtcNow, data);
            var config = new PropertyConfig
            {
                ExcludedProperties = new List <string>
                {
                    "Eighth"
                },
                JsonSerializedProperties = new List <string>
                {
                    "Third.Fifth"
                }
            };

            var actual = SeqEvents.GetProperty(evt, propertyPath, config);

            Assert.Equal(expectedMarkdown, actual);
        }