-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMyHashTableTest.cs
39 lines (32 loc) · 961 Bytes
/
MyHashTableTest.cs
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
using Algorithms.HashTables;
using Xunit;
namespace AlgorithmsTest.HashTables
{
public class MyHashTableTest
{
[Fact]
public void Insert_An_Item_And_Get_It_Back()
{
var myHashTable = new MyHashTable<int>(10);
string key = "myTest";
int value = 1000;
myHashTable.Set(key, value);
int result = myHashTable.Get(key);
Assert.Equal(value, result);
}
[Fact]
public void Insert_Items_Testing_Colission()
{
var myHashTable = new MyHashTable<int>(10);
string key = "myTest";
string key2 = "myTest2";
string key3 = "myTest7";
int value = 5;
myHashTable.Set(key, 10);
myHashTable.Set(key2, 2);
myHashTable.Set(key3, value);
int result = myHashTable.Get(key3);
Assert.Equal(value, result);
}
}
}