File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -56,14 +56,15 @@ public void SupportTests()
56
56
Assert . AreEqual ( data , result , $ "TestData did not round trip on bytes.") ;
57
57
}
58
58
59
- public class TestData : IEquatable < TestData >
59
+ public class TestData
60
60
{
61
61
public Guid Id = Guid . NewGuid ( ) ;
62
62
public TestData ( ) { }
63
63
public TestData ( ReadOnlySequence < byte > from ) { Id = new Guid ( from . ToArray ( ) ) ; }
64
64
public static implicit operator ReadOnlySequence < byte > ( TestData from ) => new ReadOnlySequence < byte > ( from . Id . ToByteArray ( ) ) ;
65
65
public override string ToString ( ) => nameof ( TestData ) + Id . ToString ( ) ;
66
- public bool Equals ( TestData other ) => this . ToString ( ) . Equals ( other . ToString ( ) ) ;
66
+ public override int GetHashCode ( ) => HashCode . Combine ( Id ) ;
67
+ public override bool Equals ( object obj ) => ( obj is TestData other ) && this . Id == other . Id ;
67
68
}
68
69
69
70
[ TestInitialize ]
You can’t perform that action at this time.
0 commit comments