2022-01-26 14:19:04 +00:00
|
|
|
using System.IO;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using INetMock.Client.Audit;
|
|
|
|
using INetMock.Client.Audit.Serialization;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace INetMock.Client.IntegrationTest.Audit.Serialization;
|
|
|
|
|
|
|
|
public class GenericReaderTest
|
|
|
|
{
|
2022-01-28 14:55:52 +00:00
|
|
|
[Theory]
|
|
|
|
[InlineData("test.ima")]
|
|
|
|
[InlineData("test2.ima")]
|
2022-02-02 13:29:11 +00:00
|
|
|
[InlineData("test3.ima")]
|
2022-01-28 14:55:52 +00:00
|
|
|
public async Task Test_ReadAllAsync_AuditFile(string testFile)
|
2022-01-26 14:19:04 +00:00
|
|
|
{
|
2022-01-28 14:55:52 +00:00
|
|
|
await using var auditFileStream = File.OpenRead(Path.Join("testdata", testFile));
|
2022-01-26 14:19:04 +00:00
|
|
|
await using IEventReader reader = new GenericReader(new ProtoReader(auditFileStream));
|
|
|
|
|
|
|
|
var count = 0;
|
|
|
|
await foreach (var ev in reader.ReadAllAsync())
|
|
|
|
{
|
|
|
|
Assert.NotNull(ev);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
Assert.True(count > 0);
|
|
|
|
}
|
|
|
|
}
|