예제 #1
0
        public static void SetupClass(TestContext context)
        {
            //publish database first by running the batch file; comment this out if already published and no further updates
            var p         = new Process();
            var startInfo = new ProcessStartInfo
            {
                WorkingDirectory = ".\\..\\..\\..\\",
                FileName         = "PublishSampleDb.bat",
                CreateNoWindow   = false,
            };

            p.StartInfo = startInfo;
            p.Start();
            p.WaitForExit();

            //reset mef (settings) in case the other test classes used it and initialized its static data in a specific way
            new Mef();

            //setup logger (resolve)
            Log = LogResolver.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
            if (Log == null)
            {
                Assert.Fail("Logger not found. Check configuration.");
            }

            Log.Debug("Unit Test Class SETUP OK");
        }
예제 #2
0
 static EntityMapper()
 {
     try
     {
         Log = LogResolver.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
     }catch (Exception e)
     {
         WriteLine($"Logger could not be resolved. Will continue without logging. INitialization exception: {e.Message}");
     }
 }
예제 #3
0
 private static ILogger ResolveLogger()
 {
     try
     {
         return(LogResolver.GetLogger(MethodBase.GetCurrentMethod().DeclaringType));
     }
     catch (Exception e)
     {
         Debug.WriteLine($"Logger could not be resolved. Will continue without logging. INitialization exception: {e.Message}");
     }
     return(default);
예제 #4
0
 static CacheManager()
 {
     try
     {
         Log = LogResolver.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
     }
     catch (Exception ex)
     {
         Debug.WriteLine($"No logger implementation found. Will not log details. {ex.Message}");
     }
 }
예제 #5
0
 static ExecuteMethodTemplates()
 {
     try
     {
         Logger =
             LogResolver.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
     }
     catch (Exception e)
     {
         Debug.WriteLine($"Logger could not be resolved. Will continue without logging. INitialization exception: {e.Message}");
     }
 }