コード例 #1
0
ファイル: BaseTest.cs プロジェクト: mingyaaaa/Brochure
        /// <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]);
        }