public void FormatCustomTokenFunction()
        {
            CustomLogEntry entry = new CustomLogEntry();

            ILogFormatter formatter = new CustomTextFormatter("Acme custom token template: [[AcmeDBLookup{value1}]]");
            string        actual    = formatter.Format(entry);

            string expected = "Acme custom token template: 1234";

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void FormatCustomTokenFunction()
        {
            CustomLogEntry entry = new CustomLogEntry();

            CustomTextFormatterData data = new CustomTextFormatterData();
            data.Template.Value = "Acme custom token template: [[AcmeDBLookup{value1}]]";

            ILogFormatter formatter = new CustomTextFormatter(data);
            string actual = formatter.Format(entry);

            string expected = "Acme custom token template: 1234";
            Assert.AreEqual(expected, actual);
        }