Example #1
0
        public void CreateLogMessage_ContainsTraceIdAsInt()
        {
            IEnumerable <CompositionTraceId> traceIds = Expectations.GetEnumValues <CompositionTraceId>();

            foreach (var traceId in traceIds)
            {
                string message = SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, traceId, "Format");
                Assert.IsTrue(message.Contains(((int)traceId).ToString()), "Should contain int version of TraceId");
            }
        }
Example #2
0
        public void CreateLogMessage_ContainsTraceEventType()
        {
            IEnumerable <SilverlightTraceWriter.TraceEventType> eventTypes = Expectations.GetEnumValues <SilverlightTraceWriter.TraceEventType>();

            foreach (var eventType in eventTypes)
            {
                string message = SilverlightTraceWriter.CreateLogMessage(eventType, CompositionTraceId.Discovery_AssemblyLoadFailed, "Format");
                Assert.IsTrue(message.Contains(eventType.ToString()), "Should contain enum string of EventType");
            }
        }
Example #3
0
        public void CreateLogMessage_ArgumentsPassed_ShouldCreateValidString()
        {
            string message = SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, CompositionTraceId.Discovery_AssemblyLoadFailed, "{0}", 9999);

            Assert.IsTrue(message.Contains("9999"));
        }
Example #4
0
        public void CreateLogMessage_ArgumentsNull_ShouldCreateValidString()
        {
            string message = SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, CompositionTraceId.Discovery_AssemblyLoadFailed, "Format", null);

            Assert.IsFalse(string.IsNullOrEmpty(message));
        }
Example #5
0
 public void CreateLogMessage_FormatNull_ThrowsArugmentNull()
 {
     ExceptionAssert.ThrowsArgumentNull("format", () =>
                                        SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, CompositionTraceId.Discovery_AssemblyLoadFailed, null));
 }