-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHamiltonianCycle.cs
43 lines (40 loc) · 1.16 KB
/
HamiltonianCycle.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using NUnit.Framework;
namespace EC_Connect_Test
{
class Program
{
[STAThread]
static void Main(string[] args)
{
string fullPath = System.Reflection.Assembly.GetAssembly(typeof(Program)).Location;
NUnit.Gui.AppEntry.Main(new string[] { fullPath });
}
}
public class MathClass
{
internal static double Divide(int A, int B)
{
if (B == 0) throw new DivideByZeroException();
return (Double)A / (Double)B;
}
}
[TestFixture]
class MyFirstTestClass
{
[Test]
public void DividingTwoIntegersResultIsDouble()
{
Double expected = 3.3;
Double actual = MathClass.Divide(33, 10);
Assert.AreEqual(expected, actual);
}
[Test]
public void DividingByZeroShouldThrow()
{
Assert.Throws<DivideByZeroException>(
() => { MathClass.Divide(33, 0); }
);
}
}
}