Skip to content

Commit 5ba0ec4

Browse files
committed
Dumb new version.
1 parent 83994e8 commit 5ba0ec4

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

Schema/Schema.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<Description>Library for converting classes to and from binary. Provides a C# Roslyn generator that automatically implements conversion logic for simple classes.</Description>
1515
<PackageId>schema</PackageId>
1616
<Title>schema</Title>
17-
<Version>0.6.20</Version>
17+
<Version>0.6.21</Version>
1818
<Authors>MeltyPlayer</Authors>
1919
</PropertyGroup>
2020

Schema/src/testing/BinarySchemaAssert.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@ public static async Task WritesAndReadsIdentically<T>(
3131
public static async Task ReadsAndWritesIdentically<T>(
3232
IBinaryReader br,
3333
bool assertExactLength = true)
34-
where T : IBinaryConvertible, new() {
34+
where T : IBinaryConvertible, new()
35+
=> await ReadsAndWritesIdentically(br, new T(), assertExactLength);
36+
37+
public static async Task ReadsAndWritesIdentically<T>(
38+
IBinaryReader br,
39+
T instance,
40+
bool assertExactLength = true)
41+
where T : IBinaryConvertible {
3542
var readerStartPos = br.Position;
36-
var instance = br.ReadNew<T>();
43+
instance.Read(br);
3744

3845
var expectedReadLength = br.Position - readerStartPos;
3946

0 commit comments

Comments
 (0)