public void Constructor_with_config_only_returns_logger()
        {
            // act
            var actual = new SextantLogger(_encompassConfig, _loggerName);

            // assert
            Assert.NotNull(actual);
        }
        public void Constructor_with_client_context_returns_logger()
        {
            // act
            var actual = new SextantLogger(_encompassConfig, _loggerName, "UnitTestClientID", "SextantLoggerUnitTests");

            // assert
            Assert.NotNull(actual);
        }
Exemple #3
0
        public void Info_writes_to_loggly()
        {
            // arrange
            var logger = new SextantLogger(_encompassConfig, _loggerName);

            // act
            logger.Info("Test info from integration test");

            // assert
            Assert.Pass("Check loggly for results");
        }
        public void Constructor_with_tags_returns_logger()
        {
            // arrange
            var additionalTags = new Dictionary <string, string>()
            {
                { "tag1", "value1" },
                { "tag2", "value2" }
            };

            // act
            var actual = new SextantLogger(_encompassConfig, _loggerName, additionalTags);

            // assert
            Assert.NotNull(actual);
        }
        public void Logger_Info_with_tags_dont_conflict_names()
        {
            // arrange
            var additionalTags = new Dictionary <string, string>()
            {
                { "tag1", "value1" },
                { "tag2", "value2" },
                { "mine", "first" }
            };

            var logger = new SextantLogger(_encompassConfig, _loggerName, additionalTags);

            var tags = new Dictionary <string, string>()
            {
                { "tag3", "value3" },
                { "mine", "second" },
                { "processid", "dont break" }
            };

            // act
            Assert.DoesNotThrow(() => logger.Info("Some message", tags));
        }