Ejemplo n.º 1
0
        public void AddObjectAsContextItem()
        {
            ContextObject obj = new ContextObject();
            Logger.SetContextItem("object", obj);

            LogEntry log = CommonUtil.GetDefaultLogEntry();
            log.Category = "MockCategoryOne";
            Logger.Write(log);

            string result = MockLogSink.GetLastEntry().ExtendedProperties["object"].ToString();
            string expected = obj.ToString();
            Assert.AreEqual(expected, result);
        }
        public void AddObjectAsContextItem()
        {
            ContextObject obj = new ContextObject();

            Logger.SetContextItem("object", obj);
            LogEntry log = CommonUtil.GetDefaultLogEntry();

            log.Categories = new string[] { "MockCategoryOne" };
            log.Severity   = TraceEventType.Error;
            Logger.Write(log);
            string result   = ((LogEntry)MockTraceListener.LastEntry).ExtendedProperties["object"].ToString();
            string expected = obj.ToString();

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 3
0
        public void AddObjectAsContextItem()
        {
            ContextObject obj = new ContextObject();

            Logger.SetContextItem("object", obj);

            LogEntry log = CommonUtil.GetDefaultLogEntry();

            log.Category = "MockCategoryOne";
            Logger.Write(log);

            string result   = MockLogSink.GetLastEntry().ExtendedProperties["object"].ToString();
            string expected = obj.ToString();

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 4
0
		public void AddObjectAsContextItem()
		{
			ContextObject obj = new ContextObject();
			Logger.SetContextItem("object", obj);

			LogEntry log = CommonUtil.GetDefaultLogEntry();
			log.Categories = new string[] { "MockCategoryOne" };
			log.Severity = TraceEventType.Error;
			Logger.Write(log);

			string result = ((LogEntry)MockTraceListener.LastEntry).ExtendedProperties["object"].ToString();
			string expected = obj.ToString();
			Assert.AreEqual(expected, result);
		}