コード例 #1
0
 public void NullPerformance()
 {
     using (var client = new DatumClient())
     {
         client.LogPerformance(null);
     }
 }
コード例 #2
0
        public void LogOccurrenceSessionNull()
        {
            var perf = this.Occurrence();

            perf.SessionIdentifier = null;
            using (var client = new DatumClient())
            {
                client.LogPerformance(perf);
            }

            var source = new Server.Core.LogCore();
            var query  = new Server.Contracts.LogQuery()
            {
                ApplicationIdentifier = Settings.ApplicationIdentifier,
            };

            var occurance = (from data in source.SelectOccurrences(query)
                             where perf.Message == data.Message
                             select data).FirstOrDefault();

            Assert.IsNotNull(occurance, "Occurrence should not be null");
            Assert.AreEqual <Guid>(perf.Token.ApplicationId, occurance.Token.ApplicationId, "Application Id should match");
            Assert.AreEqual <DateTime>(perf.OccurredOn.Date, occurance.OccurredOn.Date, "Occurred On should match");
            Assert.AreEqual <string>(perf.MachineName, occurance.MachineName, "Machine Name should match");
            Assert.AreEqual <string>(perf.Message, occurance.Message, "Message should match");
            Assert.AreEqual <string>(perf.Class, occurance.Class, "Type should match");
            Assert.AreEqual <TimeSpan>(perf.Duration, occurance.Duration, "Duration should match");
            Assert.AreEqual <string>(perf.Method, occurance.Method, "Method should match");
            Assert.AreEqual <int>(perf.ThreadId, occurance.ThreadId, "Thread Id should match");
            Assert.AreEqual <Guid?>(perf.SessionIdentifier, occurance.SessionIdentifier, "Session Identifier should match");
        }
コード例 #3
0
 public void PerformanceInvalidMethod()
 {
     using (var client = new DatumClient())
     {
         var perf = this.Occurrence();
         perf.Method = StringHelper.NullEmptyWhiteSpace();
         client.LogPerformance(perf);
     }
 }
コード例 #4
0
 public void PerformanceZeroExecutionTime()
 {
     using (var client = new DatumClient())
     {
         var perf = this.Occurrence();
         perf.Duration = TimeSpan.Zero;
         client.LogPerformance(perf);
     }
 }
コード例 #5
0
 public void PerformanceZeroThreadId()
 {
     using (var client = new DatumClient())
     {
         var perf = this.Occurrence();
         perf.ThreadId = 0;
         client.LogPerformance(perf);
     }
 }
コード例 #6
0
 public void PerformanceEmptyAppId()
 {
     using (var client = new DatumClient())
     {
         var perf = this.Occurrence();
         perf.Token.ApplicationId = Guid.Empty;
         client.LogPerformance(perf);
     }
 }
コード例 #7
0
 public void NullPerformanceToken()
 {
     using (var client = new DatumClient())
     {
         var perf = this.Occurrence();
         perf.Token = null;
         client.LogPerformance(perf);
     }
 }