2024-09-22 11:05:41 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2024-10-08 16:21:39 +08:00
|
|
|
|
using System.Diagnostics;
|
2024-09-22 11:05:41 +08:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
using CommunityToolkit.Diagnostics;
|
|
|
|
|
|
|
|
|
|
|
|
namespace ConsoleApp
|
|
|
|
|
|
{
|
|
|
|
|
|
internal class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
string str = "";
|
|
|
|
|
|
double a = 10.0;
|
|
|
|
|
|
double b = 100;
|
2024-10-08 16:21:39 +08:00
|
|
|
|
|
|
|
|
|
|
Debug.Assert(a == b);
|
2024-09-22 11:05:41 +08:00
|
|
|
|
//确保str满足条件才能继续执行,不满足即抛出异常
|
|
|
|
|
|
Guard.IsNotNullOrEmpty(str);//抛出异常
|
|
|
|
|
|
Guard.IsLessThan(a,b);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|