-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintValidWordsInArray.cs
More file actions
45 lines (38 loc) · 1.31 KB
/
PrintValidWordsInArray.cs
File metadata and controls
45 lines (38 loc) · 1.31 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
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Algorithms.Problem.Tries
{
[TestClass]
public class PrintValidWordsInArray
{
TrieOperation trieOperation = new TrieOperation();
public List<string> PrintValidWords(TrieNode root, string[] array)
{
return null;
}
[TestMethod]
public void TestPrintValidWords()
{
TrieNode root = new TrieNode();
string[] array = { "e", "o", "b", "a", "m", "g", "l"};
// populate dictionary
trieOperation.Insert(root, "go");
trieOperation.Insert(root, "goal");
trieOperation.Insert(root, "me");
trieOperation.Insert(root, "eat");
trieOperation.Insert(root, "boy");
trieOperation.Insert(root, "run");
List<string> listStr = this.PrintValidWords(root, array);
Assert.IsTrue(listStr.Contains("go"));
Assert.IsTrue(listStr.Contains("goal"));
Assert.IsTrue(listStr.Contains("me"));
// can it be printed ???
Assert.IsTrue(listStr.Contains("bo"));
Assert.IsTrue(listStr.Contains("boal"));
}
}
}