-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMathExtTests.cs
80 lines (64 loc) · 1.41 KB
/
MathExtTests.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Collections.Generic;
namespace Havit.Tests;
[TestClass]
public class MathExtTests
{
[TestMethod]
public void MathExt_IsInteger_ReturnsFalseForNull()
{
// arange
string text = null;
bool expected = false;
// act
var actual = Havit.MathExt.IsInteger(text);
// assert
Assert.AreEqual(expected, actual);
}
[TestMethod]
public void MathExt_IsInteger_ReturnsTrueForPositiveInteger()
{
// arrange
string text = "156";
bool expected = true;
// act
var actual = Havit.MathExt.IsInteger(text);
// assert
Assert.AreEqual(expected, actual);
}
[TestMethod]
public void MathExt_IsInteger_ReturnsTrueForNegativeInteger()
{
// arrange
string text = "-156";
bool expected = true;
// act
var actual = Havit.MathExt.IsInteger(text);
// assert
Assert.AreEqual(expected, actual);
}
[TestMethod]
public void MathExt_IsIntegerTest_ReturnsFalseForEmptyString()
{
// arrange
string text = String.Empty;
bool expected = false;
// act
var actual = Havit.MathExt.IsInteger(text);
// assert
Assert.AreEqual(expected, actual);
}
[TestMethod]
public void MathExt_IsIntegerTest_ReturnsFalseForInvalidValue()
{
// arrange
string text = "10.";
bool expected = false;
// act
var actual = Havit.MathExt.IsInteger(text);
// assert
Assert.AreEqual(expected, actual);
}
}