-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathValidationTests.cs
More file actions
52 lines (45 loc) · 1.59 KB
/
Copy pathValidationTests.cs
File metadata and controls
52 lines (45 loc) · 1.59 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
using NUnit.Framework;
using MsieJavaScriptEngine.Helpers;
namespace MsieJavaScriptEngine.Test.Common
{
[TestFixture]
public class ValidationTests
{
[Test]
public void NameFormatIsCorrect()
{
// Arrange
// Act
bool name1FormatIsCorrect = ValidationHelpers.CheckNameFormat("good_parts");
bool name2FormatIsCorrect = ValidationHelpers.CheckNameFormat("i18n");
bool name3FormatIsCorrect = ValidationHelpers.CheckNameFormat("fooBar");
bool name4FormatIsCorrect = ValidationHelpers.CheckNameFormat("$grid");
bool name5FormatIsCorrect = ValidationHelpers.CheckNameFormat("a");
bool name6FormatIsCorrect = ValidationHelpers.CheckNameFormat("À_la_maison");
// Assert
Assert.IsTrue(name1FormatIsCorrect);
Assert.IsTrue(name2FormatIsCorrect);
Assert.IsTrue(name3FormatIsCorrect);
Assert.IsTrue(name4FormatIsCorrect);
Assert.IsTrue(name5FormatIsCorrect);
Assert.IsTrue(name6FormatIsCorrect);
}
[Test]
public void NameFormatIsWrong()
{
// Arrange
// Act
bool name1FormatIsCorrect = ValidationHelpers.CheckNameFormat("good-parts");
bool name2FormatIsCorrect = ValidationHelpers.CheckNameFormat("1sale");
bool name3FormatIsCorrect = ValidationHelpers.CheckNameFormat("Foo Bar");
bool name4FormatIsCorrect = ValidationHelpers.CheckNameFormat("@grid");
bool name5FormatIsCorrect = ValidationHelpers.CheckNameFormat("2");
// Assert
Assert.IsFalse(name1FormatIsCorrect);
Assert.IsFalse(name2FormatIsCorrect);
Assert.IsFalse(name3FormatIsCorrect);
Assert.IsFalse(name4FormatIsCorrect);
Assert.IsFalse(name5FormatIsCorrect);
}
}
}