Rev | Line | |
---|
[17666] | 1 | using System;
|
---|
| 2 | using HeuristicLab.Algorithms.NSGA3;
|
---|
| 3 | using Microsoft.VisualStudio.TestTools.UnitTesting;
|
---|
| 4 |
|
---|
| 5 | namespace 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.