public void TestAddCustomInfo()
        {
            using (IScarfContext context = ScarfLogging.BeginInlineContext())
            {
                ScarfAction.Start(MessageType.ActionPayment);
                ScarfLogging.AddCustomInfo("organizationId", "5");
                context.Commit();
            }

            ScarfLogMessage msg = dataSource.Messages.Single();

            Assert.IsTrue(msg.AdditionalInfo.ContainsKey(ScarfLogMessage.AdditionalInfo_Custom));
            Assert.AreEqual("5", msg.AdditionalInfo[ScarfLogMessage.AdditionalInfo_Custom]["organizationId"]);
        }
示例#2
0
        public void Action()
        {
            using (IScarfContext context = ScarfLogging.BeginInlineContext())
            {
                ScarfAction.Start(MessageType.ActionCommand);
                ScarfAction.SetMessage("Performed command");
                context.Commit();
            }

            ScarfLogMessage msg = dataSource.Messages.Single();

            Assert.AreEqual(MessageClass.Action, msg.MessageClass);
            Assert.AreEqual(MessageType.ActionCommand, msg.MessageType);
        }