11using System . Buffers . Binary ;
22using Darp . Ble . Hci . Payload . Att ;
3- using FluentAssertions ;
3+ using Shouldly ;
44
55namespace Darp . Ble . Hci . Tests . Payload . Att ;
66
@@ -9,7 +9,7 @@ public sealed class AttFindInformationRspTests
99 [ Fact ]
1010 public void ExpectedOpCode_ShouldBeValid ( )
1111 {
12- AttFindInformationRsp . ExpectedOpCode . Should ( ) . HaveValue ( 0x05 ) ;
12+ AttFindInformationRsp . ExpectedOpCode . ShouldHaveValue ( 0x05 ) ;
1313 }
1414
1515 [ Theory ]
@@ -38,7 +38,7 @@ public void TryReadLittleEndian_16BitData_ShouldBeValid(string hexBytes, params
3838 {
3939 var uuidBuffer = new byte [ 2 ] ;
4040 BinaryPrimitives . WriteUInt16LittleEndian ( uuidBuffer , ( ushort ) x . Second ) ;
41- return new AttFindInformationData ( ) { Handle = ( ushort ) x . First , Uuid = uuidBuffer } ;
41+ return new AttFindInformationData { Handle = ( ushort ) x . First , Uuid = uuidBuffer } ;
4242 } )
4343 . ToArray ( ) ;
4444
@@ -48,18 +48,17 @@ public void TryReadLittleEndian_16BitData_ShouldBeValid(string hexBytes, params
4848 out int decoded
4949 ) ;
5050
51- success . Should ( ) . BeTrue ( ) ;
52- decoded . Should ( ) . Be ( 2 + 4 * findInformationData . Length ) ;
53- value . OpCode . Should ( ) . Be ( AttOpCode . ATT_FIND_INFORMATION_RSP ) ;
54- value . Format . Should ( ) . Be ( AttFindInformationFormat . HandleAnd16BitUuid ) ;
51+ success . ShouldBeTrue ( ) ;
52+ decoded . ShouldBe ( 2 + 4 * findInformationData . Length ) ;
53+ value . OpCode . ShouldBe ( AttOpCode . ATT_FIND_INFORMATION_RSP ) ;
54+ value . Format . ShouldBe ( AttFindInformationFormat . HandleAnd16BitUuid ) ;
5555 value
5656 . InformationData . ToArray ( )
5757 . Zip ( findInformationData )
58- . Should ( )
59- . AllSatisfy ( x =>
58+ . ShouldAllSatisfy ( x =>
6059 {
61- x . First . Handle . Should ( ) . Be ( x . Second . Handle ) ;
62- x . First . Uuid . ToArray ( ) . Should ( ) . BeEquivalentTo ( x . Second . Uuid . ToArray ( ) ) ;
60+ x . First . Handle . ShouldBe ( x . Second . Handle ) ;
61+ x . First . Uuid . ToArray ( ) . ShouldBe ( x . Second . Uuid . ToArray ( ) ) ;
6362 } ) ;
6463 }
6564
@@ -77,19 +76,18 @@ public void TryReadLittleEndian_128BitData_ShouldBeValid(string hexBytes, ushort
7776 out int decoded
7877 ) ;
7978
80- success . Should ( ) . BeTrue ( ) ;
81- decoded . Should ( ) . Be ( 2 + 18 * findInformationData . Length ) ;
82- value . OpCode . Should ( ) . Be ( AttOpCode . ATT_FIND_INFORMATION_RSP ) ;
83- value . Format . Should ( ) . Be ( AttFindInformationFormat . HandleAnd128BitUuid ) ;
79+ success . ShouldBeTrue ( ) ;
80+ decoded . ShouldBe ( 2 + 18 * findInformationData . Length ) ;
81+ value . OpCode . ShouldBe ( AttOpCode . ATT_FIND_INFORMATION_RSP ) ;
82+ value . Format . ShouldBe ( AttFindInformationFormat . HandleAnd128BitUuid ) ;
8483
8584 value
8685 . InformationData . ToArray ( )
8786 . Zip ( findInformationData )
88- . Should ( )
89- . AllSatisfy ( x =>
87+ . ShouldAllSatisfy ( x =>
9088 {
91- x . First . Handle . Should ( ) . Be ( x . Second . Handle ) ;
92- x . First . Uuid . ToArray ( ) . Should ( ) . BeEquivalentTo ( x . Second . Uuid . ToArray ( ) ) ;
89+ x . First . Handle . ShouldBe ( x . Second . Handle ) ;
90+ x . First . Uuid . ToArray ( ) . ShouldBe ( x . Second . Uuid . ToArray ( ) ) ;
9391 } ) ;
9492 }
9593
@@ -105,7 +103,7 @@ public void TryReadLittleEndian_ShouldBeInvalid(string hexBytes, int expectedByt
105103 byte [ ] bytes = Convert . FromHexString ( hexBytes ) ;
106104 bool success = AttFindInformationRsp . TryReadLittleEndian ( bytes , out _ , out int decoded ) ;
107105
108- success . Should ( ) . BeFalse ( ) ;
109- decoded . Should ( ) . Be ( expectedBytesDecoded ) ;
106+ success . ShouldBeFalse ( ) ;
107+ decoded . ShouldBe ( expectedBytesDecoded ) ;
110108 }
111109}
0 commit comments