public void Size_NotChangeWhenNewItemIsSameAsExists() { HashTableModel <string> model = null; "Given initialized hashtable model with size equal to 1" .x(() => { model = new HashTableModel <string>(); model.Initialize(19); model.HashFunc("Next"); model.Put("Next"); }); "When user tries to add same item to hashtable" .x(() => { model.HashFunc("Next"); model.Put("Next"); }); "Then size should not be changed" .x(() => { var size = model.Size(); size.Should().Be(1); }); }
public void User_CanNotAddAlreadyExistsItem() { HashTableModel <string> model = null; "Given initialized hashtable model with element equal 'Next'" .x(() => { model = new HashTableModel <string>(); model.Initialize(19); model.HashFunc("Next"); model.Put("Next"); }); "When user tries to add same item 'Next' again to new slot" .x(() => { model.HashFunc("Next"); model.Put("Next"); }); "Then last put status should be error" .x(() => { var code = model.LastInsertStatus(); code.Should().Be(OperationCode.Error); }); }