/// <summary> /// Calls the Overloaded GetThreatLevel Method of ErrorThreatService /// </summary> /// <param name="exceptione"></param> /// <returns>Level</returns> public AnalyzedError GetThreatLevel() { AnalyzedError Analysis = new AnalyzedError(_e); var ThreatService = new ErrorThreatService(); Analysis.Lev = ThreatService.GetThreatLevel(_e); return(Analysis); }
public void TestMongoException() { //assign bool Answer; //act var Service = new ErrorThreatService(); Answer = Service.GetThreatLevel(new MongoException("yeet")) == LogLevels.Levels.Warning; //assert Assert.IsTrue(Answer); }
public void TestMongoConfigurationException() { bool Answer; try { throw new MongoConfigurationException("f"); } catch (Exception e) { ErrorThreatService Service = new ErrorThreatService(); Answer = Service.GetThreatLevel(e) == LogLevels.Levels.Warning; } Assert.IsTrue(Answer); }
public void TestGeneralException() { bool Answer; var Service = new ErrorThreatService(); try { Answer = Service.GetThreatLevel(new Exception()) == LogLevels.Levels.Warning; } catch { throw; } Assert.IsTrue(Answer); }
public void TestUnauthorizedAccessException() { var Lev = LogLevels.Levels.Debug; try { throw new UnauthorizedAccessException(); } catch (UnauthorizedAccessException e) { var Service = new ErrorThreatService(); Lev = Service.GetThreatLevel(e); } catch { throw; } Assert.AreEqual(Lev, LogLevels.Levels.Warning); }
public void TestTimeoutException() { var Lev = LogLevels.Levels.Debug; try { throw new TimeoutException(); } catch (TimeoutException e) { var Service = new ErrorThreatService(); Lev = Service.GetThreatLevel(e); } catch { Assert.Fail(); } Assert.AreEqual(Lev, LogLevels.Levels.Error); }
public void TestHttpUnhandledException() { var Lev = LogLevels.Levels.Debug; try { throw new HttpUnhandledException(); } catch (HttpUnhandledException e) { var Service = new ErrorThreatService(); Lev = Service.GetThreatLevel(e); } catch { throw; } Assert.AreEqual(Lev, LogLevels.Levels.Warning); }
public void ErrorThreatServiceConstructorTest() { var Err = new ErrorThreatService(); Assert.IsInstanceOfType(Err, typeof(ErrorThreatService)); }