mirror of
https://github.com/whoswhip/RhythiaLib.git
synced 2026-12-05 09:18:42 +00:00
34 lines
948 B
C#
34 lines
948 B
C#
using RhythiaLib.Rhr;
|
|
|
|
namespace RhythiaLib.Tests.Rhr
|
|
{
|
|
public sealed class RhrRoundTripTests
|
|
{
|
|
[Fact]
|
|
public void SyntheticReplay_RoundTripsExactly()
|
|
{
|
|
RhrReplay original = RhrTestData.CreateCurrentReplay();
|
|
|
|
byte[] firstEncoding = RhrFile.Encode(original);
|
|
|
|
RhrReplay decoded = RhrFile.Decode(firstEncoding);
|
|
|
|
byte[] secondEncoding = RhrFile.Encode(original);
|
|
|
|
Assert.Equal(firstEncoding, secondEncoding);
|
|
}
|
|
|
|
[Theory]
|
|
[MemberData(nameof(RhrTestData.FixturePaths), MemberType = typeof(RhrTestData))]
|
|
public void RealFixture_RoundTripsExactly(string path)
|
|
{
|
|
byte[] originalBytes = File.ReadAllBytes(path);
|
|
|
|
RhrReplay replay = RhrFile.Decode(originalBytes);
|
|
byte[] encodedBytes = RhrFile.Encode(replay);
|
|
|
|
Assert.Equal(originalBytes, encodedBytes);
|
|
}
|
|
}
|
|
}
|