File tree 3 files changed +10
-10
lines changed
UnitTest/DataStructuresTests
3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ public static void AssertTreeWithDuplicatesElements()
22
22
// Insert values with duplicates
23
23
binarySearchTree . Insert ( values ) ;
24
24
25
- // ASSERT COUNT = 20 (allows duplicates)
26
- Assert . Equal ( binarySearchTree . Count , 21 ) ;
25
+ // ASSERT COUNT = 21 (allows duplicates)
26
+ Assert . Equal ( 21 , binarySearchTree . Count ) ;
27
27
28
28
// Test contains/find
29
29
Assert . True ( binarySearchTree . Contains ( 10 ) , "Wrong element." ) ;
@@ -86,7 +86,7 @@ public static void AssertTreeWithDuplicatesElements()
86
86
87
87
var enumerator = binarySearchTree . GetInOrderEnumerator ( ) ;
88
88
enumerator . MoveNext ( ) ;
89
- Assert . Equal ( enumerator . Current , 7 ) ;
89
+ Assert . Equal ( 7 , enumerator . Current ) ;
90
90
91
91
enumerator . MoveNext ( ) ;
92
92
enumerator . MoveNext ( ) ;
Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ public static void DoTest()
68
68
// Assert there are only two words under the prefix "acti" -> active, & acting
69
69
var someActiWords = trieMap . SearchByPrefix ( "acti" ) . Select ( item => item . Key ) . ToList < string > ( ) ;
70
70
Assert . Equal ( 2 , someActiWords . Count ) ;
71
- Assert . True ( someActiWords . Contains ( word_acting ) ) ;
72
- Assert . True ( someActiWords . Contains ( word_active ) ) ;
71
+ Assert . Contains ( word_acting , someActiWords ) ;
72
+ Assert . Contains ( word_active , someActiWords ) ;
73
73
74
74
// Assert that "acto" is not a word
75
75
Assert . False ( trieMap . ContainsWord ( "acto" ) ) ;
@@ -123,8 +123,8 @@ public static void DoTest()
123
123
Assert . Equal ( 8 , trieMap . Count ) ;
124
124
125
125
someActiWords = trieMap . SearchByPrefix ( "acti" ) . Select ( item => item . Key ) . ToList < string > ( ) ;
126
- Assert . Equal ( 1 , someActiWords . Count ) ;
127
- Assert . True ( someActiWords . Contains ( word_active ) ) ;
126
+ Assert . Single ( someActiWords ) ;
127
+ Assert . Contains ( word_active , someActiWords ) ;
128
128
129
129
//
130
130
// TEST ENUMERATOR
Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ public static void DoTest()
68
68
// Assert there are only two words under the prefix "acti" -> active, & acting
69
69
var someActiWords = trie . SearchByPrefix ( "acti" ) . ToList < string > ( ) ;
70
70
Assert . True ( someActiWords . Count == 2 ) ;
71
- Assert . True ( someActiWords . Contains ( word_acting ) ) ;
72
- Assert . True ( someActiWords . Contains ( word_active ) ) ;
71
+ Assert . Contains ( word_acting , someActiWords ) ;
72
+ Assert . Contains ( word_active , someActiWords ) ;
73
73
74
74
// Assert that "acto" is not a word
75
75
Assert . False ( trie . ContainsWord ( "acto" ) ) ;
@@ -119,7 +119,7 @@ public static void DoTest()
119
119
120
120
someActiWords = trie . SearchByPrefix ( "acti" ) . ToList < string > ( ) ;
121
121
Assert . True ( someActiWords . Count == 1 ) ;
122
- Assert . True ( someActiWords . Contains ( word_active ) ) ;
122
+ Assert . Contains ( word_active , someActiWords ) ;
123
123
124
124
125
125
You can’t perform that action at this time.
0 commit comments