-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
2,462 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
unittests/Faster.Map.DenseMap.Tests/DenseMapStringWrapperTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Faster.Map.Core; | ||
using Faster.Map.DenseMap; | ||
using Xunit; | ||
|
||
namespace Faster.Map.RobinhoodMap.Tests | ||
{ | ||
public class DenseMapStringWrapperTests | ||
{ | ||
|
||
[Fact] | ||
public void Emplace_StringWrapper_Should_Return_Correct_String() | ||
{ | ||
// Assign | ||
var map = new DenseMap<StringWrapper, StringWrapper>(); | ||
|
||
map.Emplace("one", "Nine"); | ||
|
||
// Act | ||
map.Get("one", out var result); ; | ||
|
||
// Assert | ||
Assert.Equal("Nine", result); | ||
} | ||
|
||
[Theory] | ||
[InlineData(1)] | ||
[InlineData(10)] | ||
[InlineData(100)] | ||
[InlineData(1000)] | ||
[InlineData(10000)] | ||
[InlineData(100000)] | ||
[InlineData(1000000)] | ||
public void Get_StringsWrapper_Return_Succesful(uint amount) | ||
{ | ||
// Arrange | ||
var map = new DenseMap<StringWrapper, StringWrapper>(); | ||
|
||
for (uint i = 0; i < amount; i++) | ||
{ | ||
map.Emplace(i.ToString(), System.Guid.NewGuid().ToString()); | ||
} | ||
|
||
for (uint i = 0; i < amount; i++) | ||
{ | ||
// Act | ||
var result = map.Get(i.ToString(), out var _); | ||
if (!result) | ||
{ | ||
// Assert | ||
Assert.Fail(); | ||
} | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.