333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace wcftest.BussinessExtension
{
    public class VirtualModeHelper
    {
        /// <summary>
        /// 模拟环境下抛出异常
        /// </summary>
        /// <param name="IsVirtualMode"></param>
        public static void ThrowExceptionWhenVirtualMode(bool IsVirtualMode)
        {
            if (IsVirtualMode)
            {
                //模拟环境下,认为抛出异常
                //在测试环境下,你可以屏蔽该代码
                //发布到生产环境,请打开该代码
                //throw new Exception("此次是模拟环境!警告");
            }
        }
    }
}