Assert.AreNotEqual 方法 (Double, Double, Double)
验证指定的两个双精度型值是否既不相等又不在对方的指定精度内。 如果它们相等或者在对方的指定精度内,则断言失败。
命名空间: Microsoft.VisualStudio.TestTools.UnitTesting
程序集: Microsoft.VisualStudio.QualityTools.UnitTestFramework(在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)
语法
声明
Public Shared Sub AreNotEqual ( _
notExpected As Double, _
actual As Double, _
delta As Double _
)
public static void AreNotEqual(
double notExpected,
double actual,
double delta
)
public:
static void AreNotEqual(
double notExpected,
double actual,
double delta
)
static member AreNotEqual :
notExpected:float *
actual:float *
delta:float -> unit
public static function AreNotEqual(
notExpected : double,
actual : double,
delta : double
)
参数
- notExpected
类型:System.Double
要比较的第一个双精度型。单元测试要求该双精度型值与 actual 不匹配。
- actual
类型:System.Double
要比较的第二个双精度型。这是单元测试生成的双精度型值。
- delta
类型:System.Double
要求的误差。只有当 notExpected 与 actual 相等或者它们的差小于 delta 时断言才失败。
异常
异常 | 条件 |
---|---|
AssertFailedException | notExpected 与 actual 相等或者它们的差小于 delta。 |
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
请参见
参考
Microsoft.VisualStudio.TestTools.UnitTesting 命名空间