1- // Licensed to the .NET Foundation under one or more agreements.
1+ // Licensed to the .NET Foundation under one or more agreements.
22// The .NET Foundation licenses this file to you under the MIT license.
33
44using System ;
@@ -223,12 +223,12 @@ public void GetInteger_ValidSegmentedSequence()
223223 MemorySegment < byte > memorySegment2 = memorySegment1 . Append ( new byte [ ] { 0 , 0 , 0 , 0 , 0 , 0 , 2 } ) ;
224224 ReadOnlySequence < byte > readOnlySequence = new ReadOnlySequence < byte > (
225225 memorySegment1 , 0 , memorySegment2 , memorySegment2 . Memory . Length ) ;
226- long result = VariableLengthIntegerHelper . GetInteger ( readOnlySequence ,
227- out SequencePosition consumed , out SequencePosition examined ) ;
226+ bool result = VariableLengthIntegerHelper . TryGetInteger ( readOnlySequence ,
227+ out SequencePosition consumed , out long integer ) ;
228228
229- Assert . Equal ( 2 , result ) ;
229+ Assert . True ( result ) ;
230+ Assert . Equal ( 2 , integer ) ;
230231 Assert . Equal ( 7 , consumed . GetInteger ( ) ) ;
231- Assert . Equal ( 7 , examined . GetInteger ( ) ) ;
232232 }
233233
234234 [ Fact ]
@@ -238,12 +238,11 @@ public void GetInteger_NotValidSegmentedSequence()
238238 MemorySegment < byte > memorySegment2 = memorySegment1 . Append ( new byte [ ] { 0 , 0 , 0 , 0 , 0 , 2 } ) ;
239239 ReadOnlySequence < byte > readOnlySequence = new ReadOnlySequence < byte > (
240240 memorySegment1 , 0 , memorySegment2 , memorySegment2 . Memory . Length ) ;
241- long result = VariableLengthIntegerHelper . GetInteger ( readOnlySequence ,
242- out SequencePosition consumed , out SequencePosition examined ) ;
241+ bool result = VariableLengthIntegerHelper . TryGetInteger ( readOnlySequence ,
242+ out SequencePosition consumed , out long integer ) ;
243243
244- Assert . Equal ( - 1 , result ) ;
244+ Assert . False ( result ) ;
245245 Assert . Equal ( 0 , consumed . GetInteger ( ) ) ;
246- Assert . Equal ( 6 , examined . GetInteger ( ) ) ;
247246 }
248247
249248 [ Fact ]
0 commit comments