aalhour / C-Sharp-Algorithms

:books: :chart_with_upwards_trend: Plug-and-play class-library project of standard Data Structures and Algorithms in C#

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ChainedHashTable test sometimes fail

PatrykOlejniczak opened this issue · comments

Describe the bug
During development some other feature, and run frequently "dotnet test" i notice that some test connected to ChainedHashTable sometimes pass sometimes not. Problem also occur on clear master branch.

To Reproduce
Run dotnet test command many times, that test doesn't crash every time.

Expected behavior
Test should always pass.

Additional context
X UnitTest.DataStructuresTests.HashTableSeparateChainingTest.DoTest [61ms]
Error Message:
System.NullReferenceException : Object reference not set to an instance of an object.
Stack Trace:
at DataStructures.Dictionaries.ChainedHashTable2.CopyTo(KeyValuePair2[] array, Int32 arrayIndex) in D:\repositories\public\C-Sharp-Algorithms\DataStructures\Dictionaries\ChainedHashTable.cs:line 609
at UnitTest.DataStructuresTests.HashTableSeparateChainingTest.DoTest() in D:\repositories\public\C-Sharp-Algorithms\UnitTest\DataStructuresTests\HashTableSeparateChainingTest.cs:line 107

I create pull request for fixing this bug. And i added description why this bug occured to pull request.