Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2825-NSGA3/HeuristicLab.Algorithms.NSGA3-3.3.Test/UtilityTests.cs @ 17666

Last change on this file since 17666 was 17666, checked in by dleko, 4 years ago

#2825 Add Unit test project.

File size: 743 bytes
Line 
1using System;
2using HeuristicLab.Algorithms.NSGA3;
3using Microsoft.VisualStudio.TestTools.UnitTesting;
4
5namespace HeuristicLab.Algorithms.NSGA3_3._3.Test
6{
7    [TestClass]
8    public class UtilityTests
9    {
10        [DataTestMethod]
11        [DataRow(0, 1)]
12        [DataRow(1, 1)]
13        [DataRow(3, 6)]
14        [DataRow(4, 24)]
15        public void TestFactorial(int input, int result)
16        {
17            Assert.AreEqual(result, Utility.Factorial(input));
18        }
19
20        [DataTestMethod]
21        [DataRow(-1)]
22        [DataRow(31)]
23        public void TestFactorial2(int input)
24        {
25            Assert.ThrowsException<InvalidOperationException>(() => { Utility.Factorial(input); });
26        }
27    }
28}
Note: See TracBrowser for help on using the repository browser.