Fix nullability issue

This commit is contained in:
Peter 2022-01-28 15:55:52 +01:00
parent 48a94cb1aa
commit 19b3ae16cb
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
4 changed files with 9 additions and 5 deletions

View file

@ -39,7 +39,9 @@ public abstract record EventBase()
public ushort DestinationPort { get; init; } public ushort DestinationPort { get; init; }
public TLSDetailsEntity TlsDetails { get; init; } = new(); public TLSDetailsEntity? TlsDetails { get; init; }
public bool IsTls => TlsDetails != null;
} }
public record Event : EventBase public record Event : EventBase

View file

@ -8,10 +8,12 @@ namespace INetMock.Client.IntegrationTest.Audit.Serialization;
public class GenericReaderTest public class GenericReaderTest
{ {
[Fact] [Theory]
public async Task Test_ReadAllAsync_AuditFile() [InlineData("test.ima")]
[InlineData("test2.ima")]
public async Task Test_ReadAllAsync_AuditFile(string testFile)
{ {
await using var auditFileStream = File.OpenRead(Path.Join("testdata", "test.ima")); await using var auditFileStream = File.OpenRead(Path.Join("testdata", testFile));
await using IEventReader reader = new GenericReader(new ProtoReader(auditFileStream)); await using IEventReader reader = new GenericReader(new ProtoReader(auditFileStream));
var count = 0; var count = 0;

View file

@ -28,7 +28,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="testdata\test.ima"> <None Update="testdata\*.ima">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>

Binary file not shown.