JD2022-TU1/main/tools/framework/JD.Remoting/Tests/BlobTests.cs

23 lines
No EOL
671 B
C#

using System.IO;
using JD.Remoting.Details;
using JD.Remoting.Exceptions;
using NUnit.Framework;
namespace JD.Remoting.Tests
{
[TestFixture]
public class BlobTests
{
[Test]
public void Test_blob_validates_the_read_type()
{
var blob = new Blob(allowRead: true);
blob.Push(12);
blob.Seek(0, SeekOrigin.Begin);
var exception = Assert.Throws<RemotingInvalidDataException>(() => blob.ExtractByte());
Assert.That(exception.Message.Contains(DataType.DataType_i32.ToString()));
Assert.That(exception.Message.Contains(DataType.DataType_u8.ToString()));
}
}
}