You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
587 B
24 lines
587 B
using System;
|
|
using System.Text;
|
|
using MediaBrowser.Common;
|
|
using Xunit;
|
|
|
|
namespace Jellyfin.Common.Tests
|
|
{
|
|
public static class Crc32Tests
|
|
{
|
|
[Fact]
|
|
public static void Compute_Empty_Zero()
|
|
{
|
|
Assert.Equal<uint>(0, Crc32.Compute(Array.Empty<byte>()));
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(0x414fa339, "The quick brown fox jumps over the lazy dog")]
|
|
public static void Compute_Valid_Success(uint expected, string data)
|
|
{
|
|
Assert.Equal(expected, Crc32.Compute(Encoding.UTF8.GetBytes(data)));
|
|
}
|
|
}
|
|
}
|