/// <summary> /// Gets the mock service. /// </summary> /// <returns>A Mock.</returns> public Mock <T> GetMockService <T>() where T : class { var type = typeof(T); if (!MockService.ContainsKey(type)) { throw new Exception("Mock服务没有注册"); } return((Mock <T>)MockService[type]); }