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()
5656 Assert . AreEqual ( data , result , $ "TestData did not round trip on bytes.") ;
5757 }
5858
59- public class TestData : IEquatable < TestData >
59+ public class TestData
6060 {
6161 public Guid Id = Guid . NewGuid ( ) ;
6262 public TestData ( ) { }
6363 public TestData ( ReadOnlySequence < byte > from ) { Id = new Guid ( from . ToArray ( ) ) ; }
6464 public static implicit operator ReadOnlySequence < byte > ( TestData from ) => new ReadOnlySequence < byte > ( from . Id . ToByteArray ( ) ) ;
6565 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 ;
6768 }
6869
6970 [ TestInitialize ]
You can’t perform that action at this time.
0 commit comments