@@ -40,6 +40,7 @@ public static void Adding_TwoDuplicateElements_ReturnsException()
40
40
41
41
var exception = Assert . Throws < ArgumentException > ( act ) ;
42
42
Assert . Equal ( "Key already exists in the hash table." , exception . Message ) ;
43
+ Assert . True ( studentsMarks . Count == 2 ) ;
43
44
}
44
45
45
46
[ Fact ]
@@ -52,6 +53,7 @@ public static void GetElement_ExistingElement_ReturnsElement()
52
53
var value = studentsMarks [ "Name2" ] ;
53
54
54
55
Assert . Equal ( 5 , value ) ;
56
+ Assert . True ( studentsMarks . Count == 2 ) ;
55
57
}
56
58
57
59
[ Fact ]
@@ -65,6 +67,7 @@ public static void GetElement_NonExistingElement_ReturnsException()
65
67
Action act = ( ) => value = studentsMarks [ "Name3" ] ;
66
68
67
69
Assert . Throws < KeyNotFoundException > ( act ) ;
70
+ Assert . True ( studentsMarks . Count == 2 ) ;
68
71
}
69
72
70
73
[ Fact ]
@@ -120,6 +123,11 @@ public static void CopyTo_FilledHashTable_ReturnsSuccessful()
120
123
Assert . Equal ( "Name1" , arrayKeys [ 0 ] ) ;
121
124
Assert . Equal ( "Name2" , arrayKeys [ 1 ] ) ;
122
125
Assert . Equal ( "Name3" , arrayKeys [ 2 ] ) ;
126
+ var arrayValues = array . Select ( x => x . Value ) . OrderBy ( x => x ) . ToArray ( ) ;
127
+ Assert . Equal ( 1 , arrayValues [ 0 ] ) ;
128
+ Assert . Equal ( 3 , arrayValues [ 1 ] ) ;
129
+ Assert . Equal ( 5 , arrayValues [ 2 ] ) ;
130
+
123
131
}
124
132
125
133
[ Fact ]
0 commit comments