-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMagexBuilderTest.cs
More file actions
68 lines (55 loc) · 1.68 KB
/
MagexBuilderTest.cs
File metadata and controls
68 lines (55 loc) · 1.68 KB
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
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MagicExpression.Test
{
[TestClass]
public class MagexBuilderTest : MagicTest
{
[TestInitialize]
public override void Setup()
{
base.Setup();
}
[TestMethod]
public void RangeChar()
{
this.Magic.Range('a', 'f');
this.AssertIsMatching("a", "d");
this.AssertIsNotMatching("k", "52");
}
[TestMethod]
public void RangeNum()
{
this.Magic.Range('0', '5');
this.AssertIsMatching("0", "4");
this.AssertIsNotMatching("8", " ");
}
[TestMethod]
public void RangeExtendedNumeric()
{
this.Magic.Range(0, 42);
this.AssertIsMatching("0", "9", "19", "20", "42");
this.AssertIsNotMatching("43", "52");
}
[TestMethod]
public void RangeInBetween()
{
this.Magic.Character('a').Range(0, 42).Character('a');
this.AssertIsMatching("a0a", "a9a", "a19a", "a20a", "a42a");
this.AssertIsNotMatching("", "%", "a9b", "b52a", "4242");
}
[TestMethod]
public void RangeCharBounds()
{
this.Magic.Range('a', 'g').Character('a');
this.AssertIsMatching("aa", "da");
this.AssertIsNotMatching("a", "5", string.Empty, "$");
}
[TestMethod]
public void RangeMixedBounds()
{
this.Magic.Range(0, 4, 'a', 'g');
this.AssertIsMatching("0", "3", "a", "d");
this.AssertIsNotMatching("", "5", "k", string.Empty, "$");
}
}
}