随机填充指定对象的属性。可用于构造随机数据进行测试
智能大石头
authored at
2022-06-28 21:56:42
X
using NewLife.Data;
using NewLife.Security;
using Xunit;
namespace XUnitTest.Security
{
public class RandTests
{
[Fact]
public void Fill()
{
var area = new GeoArea();
Rand.Fill(area);
Assert.True(area.Code > 0);
Assert.NotEmpty(area.Name);
}
}
}
|