Beispiel #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");
            }
        }
Beispiel #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");
            }
        }
Beispiel #3
0
        public void CreateLogMessage_ArgumentsPassed_ShouldCreateValidString()
        {
            string message = SilverlightTraceWriter.CreateLogMessage(SilverlightTraceWriter.TraceEventType.Information, CompositionTraceId.Discovery_AssemblyLoadFailed, "{0}", 9999);

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

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