/// <summary> /// calls method To create responseservices depending on type of exception and level of severity, and then executes them /// </summary> /// <param name="e"></param> /// <param name="level"></param> public AnalyzedError GetResponse(AnalyzedError Err) { IErrorResponseService ResponseService; if (Err.Lev == LogLevels.Levels.Fatal) { ResponseService = new FatalResponseService(Err); } else if (Err.Lev == LogLevels.Levels.Error) { ResponseService = new ErrorResponseService(Err); } else { ResponseService = new WarningResponseService(Err); } try { LogService.Log(Err.ToString()); } catch (Exception caught) { var Failure = new FatalResponseService(new AnalyzedError(caught) { Lev = LogLevels.Levels.Fatal }); Failure.GetResponse(); } return(ResponseService.GetResponse()); }
public void FatalResponseServiceConstructorTest() { var Err = new FatalResponseService(new AnalyzedError(new Exception())); Assert.IsInstanceOfType(Err, typeof(FatalResponseService)); }