コード例 #1
0
 public void IsNaN()
 {
     Assert.DoesNotThrow(() => Assert.IsNaN(float.NaN));
     Assert.DoesNotThrow(() => Assert.IsNaN(double.NaN));
     Assert.ThrowsExact <AssertionException>(() => Assert.IsNaN(float.PositiveInfinity));
     Assert.ThrowsExact <AssertionException>(() => Assert.IsNaN(float.NegativeInfinity));
     Assert.ThrowsExact <AssertionException>(() => Assert.IsNaN(1.34f));
     Assert.ThrowsExact <AssertionException>(() => Assert.IsNaN(double.PositiveInfinity));
     Assert.ThrowsExact <AssertionException>(() => Assert.IsNaN(double.NegativeInfinity));
     Assert.ThrowsExact <AssertionException>(() => Assert.IsNaN(1.34d));
 }