public MemorySessionFactoryTest() { Options = new BoltServerOptions(); SesionHandler = new Mock<IServerSessionHandler>(MockBehavior.Loose); Subject = new MemorySessionFactory(Options, SesionHandler.Object); Instance = new InstanceInternal(); }
public MemorySessionFactoryTest() { Options = new BoltServerOptions(); SesionHandler = new Mock <IServerSessionHandler>(MockBehavior.Loose); Subject = new MemorySessionFactory(Options, SesionHandler.Object); Instance = new InstanceInternal(); }
/// <summary> /// 处理特定的异常. /// </summary> /// <typeparam name="TException">要处理的异常的类型.</typeparam> /// <param name="ex">要处理的例外.</param> /// <returns>如果可以成功处理异常,则为true,否则为false.</returns> public static bool HandleException <TException>(TException ex) where TException : Exception { return(InstanceInternal.HandleExceptionInternal((Exception)ex)); }
/// <summary> /// 处理特定的异常. /// </summary> /// <param name="ex">要处理的例外.</param> /// <returns>如果可以成功处理异常,则为true,否则为false.</returns> public static bool HandleException(Exception ex) { return(InstanceInternal.HandleExceptionInternal(ex)); }
/// <summary> /// 获取OFoods配置部分中注册的所有异常类型. /// </summary> /// <returns>已注册的异常类型列表.</returns> public static IEnumerable <Type> GetRegisteredExceptionTypes() { return(InstanceInternal.GetRegisteredExceptionTypesInternal()); }
/// <summary> /// 获取特定异常类型的异常处理程序列表. /// </summary> /// <typeparam name="TException">异常类型.</typeparam> /// <returns>异常处理程序的列表.</returns> public static IEnumerable <IExceptionHandler> GetExceptionHandlers <TException>() where TException : Exception { return(InstanceInternal.GetExceptionHandlersInternal <TException>()); }
/// <summary> /// 获取特定异常类型的异常处理程序列表. /// </summary> /// <param name="exceptionType">异常类型.</param> /// <returns>异常处理程序的列表.</returns> public static IEnumerable <IExceptionHandler> GetExceptionHandlers(Type exceptionType) { return(InstanceInternal.GetExceptionHandlersInternal(exceptionType)); }