NUnit.Framework.Assert.IsNaN(double)

Here are the examples of the csharp api class NUnit.Framework.Assert.IsNaN(double) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

33 Examples 7

1. Example

View license
[Test]
		[ExpectedException(typeof(AssertionException))]
		public void IsNaNFails()
		{
			expectedMessage =
				"  Expected: NaN" + Environment.NewLine +
				"  But was:  10.0d" + Environment.NewLine;
			Assert.IsNaN(10.0);
		}

2. Example

View license
[Test]
		public void IsNaN()
		{
			Assert.IsNaN(double.NaN);
		}

3. Example

View license
[Test]
		[ExpectedException(typeof(AssertionException))]
		public void IsNaNFails()
		{
			expectedMessage =
				"  Expected: NaN" + Environment.NewLine +
				"  But was:  10.0d" + Environment.NewLine;
			Assert.IsNaN(10.0);
		}

4. Example

View license
[Test]
		public void IsNaN()
		{
			Assert.IsNaN(double.NaN);
		}

5. Example

View license
[Test]
		public void IsNaN()
		{
			Assert.IsNaN(double.NaN);
		}

6. Example

View license
[Test]
		[ExpectedException(typeof(AssertionException))]
		public void IsNaNFails()
		{
			expectedMessage =
				"  Expected: NaN" + Environment.NewLine +
				"  But was:  10.0d" + Environment.NewLine;
			Assert.IsNaN(10.0);
		}

7. Example

View license
[Test]
		[ExpectedException(typeof(AssertionException))]
		public void IsNaNFails()
		{
			expectedMessage =
				"  Expected: NaN" + Environment.NewLine +
				"  But was:  10.0d" + Environment.NewLine;
			Assert.IsNaN(10.0);
		}

8. Example

Project: nunit
Source File: ConditionAssertTests.cs
View license
[Test]
        public void IsNaN()
        {
            Assert.IsNaN(double.NaN);
        }

9. Example

Project: nunitlite
Source File: ConditionAssertTests.cs
View license
[Test]
		public void IsNaN()
		{
			Assert.IsNaN(double.NaN);
		}

10. Example

Project: nunitlite
Source File: ConditionAssertTests.cs
View license
[Test]
		[ExpectedException(typeof(AssertionException))]
		public void IsNaNFails()
		{
			expectedMessage =
				"  Expected: NaN" + Env.NewLine +
				"  But was:  10.0d" + Env.NewLine;
			Assert.IsNaN(10.0);
		}

11. Example

Project: Mages
Source File: FunctionTests.cs
View license
[Test]
        public void CreateMagesFunctionShouldNotBeClassicallyCallableWithoutRightTypes()
        {
            var foo = "(x, y) => x * y + y".Eval() as Function;
            var result = foo.Invoke(new Object[] { 2, 3 });
            Assert.IsNaN((Double)result);
        }

12. Example

View license
[Test]
		[ExpectedException(typeof(AssertionException))]
		public void IsNaNFails()
		{
			expectedMessage =
				"  Expected: NaN" + Environment.NewLine +
				"  But was:  10.0d" + Environment.NewLine;
			Assert.IsNaN(10.0);
		}

13. Example

View license
[Test]
		[ExpectedException(typeof(AssertionException))]
		public void IsNaNFails()
		{
			expectedMessage =
				"  Expected: NaN" + Environment.NewLine +
				"  But was:  10.0d" + Environment.NewLine;
			Assert.IsNaN(10.0);
		}

14. Example

View license
[Test]
		public void IsNaN()
		{
			Assert.IsNaN(double.NaN);
		}

15. Example

View license
[Test]
		public void IsNaN()
		{
			Assert.IsNaN(double.NaN);
		}

16. Example

View license
[Test]
		public void IsNaN()
		{
			Assert.IsNaN(double.NaN);
		}

17. Example

Project: nunit
Source File: NullableTypesTests.cs
View license
[Test]
        public void CanTestForNaN()
        {
            double? anNaN = Double.NaN;
            Assert.IsNaN(anNaN);
            Assert.That(anNaN, Is.NaN);
        }

18. Example

View license
[Test]
        public void MovingAverageMissingData()
        {
            var average = new[] { 1.0, double.NaN, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, double.NaN, 10.0 }.MovingAverage(2).ToArray();
            Assert.AreEqual(average.Length, 10);
            Assert.AreEqual(1.0, average[0]);
            Assert.IsNaN(average[1]);
            Assert.IsNaN(average[2]);
            Assert.AreEqual(3.5, average[3]);
            Assert.AreEqual(4.5, average[4]);
            Assert.AreEqual(5.5, average[5]);
            Assert.AreEqual(6.5, average[6]);
            Assert.AreEqual(7.5, average[7]);
            Assert.IsNaN(average[8]);
            Assert.IsNaN(average[9]);
        }

19. Example

View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

20. Example

Project: NPOI
Source File: TestDataSources.cs
View license
[Test]
        public void TestMixedCellDataSource()
        {
            IWorkbook wb = new HSSFWorkbook();
            ISheet sheet = new SheetBuilder(wb, mixedCells).Build();
            CellRangeAddress mixedCellRange = CellRangeAddress.ValueOf("A1:F1");
            IChartDataSource<String> strDataSource = DataSources.FromStringCellRange(sheet, mixedCellRange);
            IChartDataSource<double> numDataSource = DataSources.FromNumericCellRange(sheet, mixedCellRange);
            for (int i = 0; i < mixedCells[0].Length; ++i)
            {
                if (i%2 == 0)
                {
                    Assert.IsNull(strDataSource.GetPointAt(i));
                    Assert.AreEqual(((double) mixedCells[0][i]),
                                    numDataSource.GetPointAt(i), 0.00001);
                }
                else
                {
                    Assert.IsNaN(numDataSource.GetPointAt(i));
                    Assert.AreEqual(mixedCells[0][i], strDataSource.GetPointAt(i));
                }
            }
        }

21. Example

View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

22. Example

Project: Mages
Source File: OperationTests.cs
View license
[Test]
        public void InitMatrixWithNonExistingValuesYieldsNaN()
        {
            var result = "[a, b, c]".Eval() as Double[,];
            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Length);
            Assert.IsNaN(result[0, 0]);
            Assert.IsNaN(result[0, 1]);
            Assert.IsNaN(result[0, 2]);
        }

23. Example

View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

24. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

25. Example

Project: grisu.net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

26. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

27. Example

Project: AutoTest.Net
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

28. Example

Project: Pash
Source File: AssertSyntaxTests.cs
View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

29. Example

View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

30. Example

View license
[Test]
		public void IsNaN()
		{
			double d = double.NaN;
			float f = float.NaN;

			// Classic syntax
			Assert.IsNaN(d);
			Assert.IsNaN(f);

			// Helper syntax
			Assert.That(d, Is.NaN);
			Assert.That(f, Is.NaN);
			
			// Inherited syntax
			Expect(d, NaN);
			Expect(f, NaN);
		}

31. Example

View license
[Test]
        public void IsNaN()
        {
            double d = double.NaN;
            float f = float.NaN;

            // Classic syntax
            Assert.IsNaN(d);
            Assert.IsNaN(f);

            // Constraint Syntax
            Assert.That(d, Is.NaN);
            Assert.That(f, Is.NaN);
            
            // Inherited syntax
            Expect(d, NaN);
            Expect(f, NaN);
        }

32. Example

View license
[Test]
        public void ParseValueMappingsTest()
        {
            var file = new IniFile();
/n ..... /n //View Source file for more details /n }

33. Example

Project: nunit
Source File: ConditionAssertTests.cs
View license
[Test]
        public void IsNaNFails()
        {
            var expectedMessage =
                "  Expected: NaN" + Environment.NewLine +
                "  But was:  10.0d" + Environment.NewLine;
            var ex = Assert.Throws<AssertionException>(() => Assert.IsNaN(10.0));
            Assert.That(ex.Message, Is.EqualTo(expectedMessage));
        }