File tree 1 file changed +32
-0
lines changed
src/Nethermind/Nethermind.Serialization.FluentRlp.Test
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ // SPDX-FileCopyrightText: 2025 Demerzel Solutions Limited
2
+ // SPDX-License-Identifier: LGPL-3.0-only
3
+
4
+ using FluentAssertions ;
5
+ using FluentAssertions . Collections ;
6
+
7
+ namespace Nethermind . Serialization . FluentRlp . Test ;
8
+
9
+ // NOTE: `FluentAssertions` currently does not support `(ReadOnly)Span<T>` or `(ReadOnly)Memory<T>` assertions.
10
+ public static class Extensions
11
+ {
12
+ public static GenericCollectionAssertions < T > Should < T > ( this ReadOnlySpan < T > span ) => span . ToArray ( ) . Should ( ) ;
13
+ public static GenericCollectionAssertions < T > Should < T > ( this ReadOnlyMemory < T > memory ) => memory . ToArray ( ) . Should ( ) ;
14
+
15
+ public static AndConstraint < GenericCollectionAssertions < TExpectation > > BeEquivalentTo < TExpectation > (
16
+ this GenericCollectionAssertions < TExpectation > @this ,
17
+ ReadOnlySpan < TExpectation > expectation ,
18
+ string because = "" ,
19
+ params object [ ] becauseArgs )
20
+ {
21
+ return @this . BeEquivalentTo ( expectation . ToArray ( ) , config => config , because , becauseArgs ) ;
22
+ }
23
+
24
+ public static AndConstraint < GenericCollectionAssertions < TExpectation > > BeEquivalentTo < TExpectation > (
25
+ this GenericCollectionAssertions < TExpectation > @this ,
26
+ ReadOnlyMemory < TExpectation > expectation ,
27
+ string because = "" ,
28
+ params object [ ] becauseArgs )
29
+ {
30
+ return @this . BeEquivalentTo ( expectation . ToArray ( ) , config => config , because , becauseArgs ) ;
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments