Beispiel #1
0
 private static void AddDebugInfo(DebugInfo info, Exception e = null)
 {
     if (e == null)
     {
         Logger.Debug(string.Format("{0} {1}", info.Type, info.Description));
     }
     else
     {
         Logger.Error(e, info.Description);
     }
     if (ConfigurationManager.AppSettings["RecordDebugInfo"] == "true")
     {
         _debugInfoService.Add(info);
     }
 }
Beispiel #2
0
        public void Add_will_set_info_updated_by_to_empty_string()
        {
            //arrange
            var debug1 = new DebugInfo()
            {
                Id = 1, UpdatedBy = "test-to-be-set-to-empty"
            };
            var mut = new DebugInfoService(_debugInfoRepository);

            //act
            mut.Add(debug1);
            var result = _debugInfoRepository.GetQuery().First(x => x.Id == 1);

            //assert
            Assert.AreEqual("", result.UpdatedBy);
            //cleanup
            _debugInfoRepository.Delete(debug1);
        }