-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
63 lines (56 loc) · 1.68 KB
/
Program.cs
File metadata and controls
63 lines (56 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
using System;
using TextFilter;
namespace TextFilter
{
class Program
{
static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.White;
// [Input, Expected Output]
string[,] testCases = new string[,]
{
//{"ass", "***" },
//{"sass", "sass" },
//{"@55", "***" },
//{"pass", "pass" },
//{"p@ss", "p@ss" },
//{"The a.s.s", "The *.*.*" },
//{"The ass is mad.", "The *** is mad." },
//{"The @55 is mad.", "The *** is mad." },
//{"The @55 i5 m@d.", "The *** i5 m@d." },
{"ass n ass", "*** n ***" },
{"The ass is an ass.", "The *** is an ***." },
{"The @$$ i5 an ass.", "The *** i5 an ***." },
{"The @$$ i5 an @$$.", "The *** i5 an ***." },
{"Can you pass?", "Can you pass?" },
{"Can you p@s5?", "Can you p@s5?" },
{"Can you pass the ass?", "Can you pass the ***?" },
{"Can you p@s5 the @s$?", "Can you p@s5 the ***?" }
};
TextFilter TF = new TextFilter();
for (int i = 0; i < testCases.GetLength(0); i++)
{
string OriginalText = testCases[i, 0];
string FilteredText = TF.FilteredText(OriginalText);
string ExpectedText = testCases[i, 1];
Console.WriteLine("Case: " + i);
Console.WriteLine(" Original: " + OriginalText);
Console.WriteLine(" Filtered: " + FilteredText);
Console.WriteLine(" Expected: " + ExpectedText);
if (FilteredText.Equals(ExpectedText))
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine("Result: Pass");
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Result: Fail");
}
Console.ForegroundColor = ConsoleColor.White;
//Console.WriteLine();
}
}
}
}