forked from VahidN/EFCoreSecondLevelCacheInterceptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXxHashTests.cs
More file actions
37 lines (33 loc) · 1.35 KB
/
XxHashTests.cs
File metadata and controls
37 lines (33 loc) · 1.35 KB
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
using Microsoft.VisualStudio.TestTools.UnitTesting;
[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.MethodLevel)] // Workers: The number of threads to run the tests. Set it to 0 to use the number of core of your computer.
namespace EFCoreSecondLevelCacheInterceptor.Tests
{
internal sealed class TestConstants
{
public static readonly string Empty = "";
public static readonly string FooBar = "foobar";
public static readonly string LoremIpsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ornare aliquam mauris, at volutpat massa. Phasellus pulvinar purus eu venenatis commodo.";
}
[TestClass]
public class XxHashTests
{
[TestMethod]
public void TestEmptyXxHashReturnsCorrectValue()
{
var hash = XxHashUnsafe.ComputeHash(TestConstants.Empty);
Assert.AreEqual((uint)0x02cc5d05, hash);
}
[TestMethod]
public void TestFooBarXxHashReturnsCorrectValue()
{
var hash = XxHashUnsafe.ComputeHash(TestConstants.FooBar);
Assert.AreEqual((uint)2348340516, hash);
}
[TestMethod]
public void TestLoremIpsumXxHashReturnsCorrectValue()
{
var hash = XxHashUnsafe.ComputeHash(TestConstants.LoremIpsum);
Assert.AreEqual((uint)4046722717, hash);
}
}
}