File tree Expand file tree Collapse file tree 7 files changed +193
-183
lines changed
Expand file tree Collapse file tree 7 files changed +193
-183
lines changed Original file line number Diff line number Diff line change 2828using Moq ;
2929using RfmOta . Exceptions ;
3030using RfmOta . Factory ;
31- using RfmUsb ;
31+ using RfmUsb . Net ;
3232using System ;
3333using System . Collections . Generic ;
3434using System . IO ;
@@ -41,12 +41,12 @@ public class OtaServiceTests
4141 {
4242 private readonly Mock < IIntelHexStreamReaderFactory > _mockIntelHexReaderFactory ;
4343 private readonly Mock < IIntelHexStreamReader > _mockIntelHexStreamReader ;
44- private readonly Mock < IRfmUsb > _mockRfmUsb ;
44+ private readonly Mock < IRfm69 > _mockRfmUsb ;
4545 private readonly OtaService _otaService ;
4646
4747 public OtaServiceTests ( )
4848 {
49- _mockRfmUsb = new Mock < IRfmUsb > ( ) ;
49+ _mockRfmUsb = new Mock < IRfm69 > ( ) ;
5050 _mockIntelHexStreamReader = new Mock < IIntelHexStreamReader > ( ) ;
5151 _mockIntelHexReaderFactory = new Mock < IIntelHexStreamReaderFactory > ( ) ;
5252
@@ -98,7 +98,7 @@ public void TestOtaUpdate()
9898 [ Theory ]
9999 [ InlineData ( - 3 ) ]
100100 [ InlineData ( 21 ) ]
101- public void TestOtaUpdateInvalidPowerLevel ( int outputPower )
101+ public void TestOtaUpdateInvalidPowerLevel ( sbyte outputPower )
102102 {
103103 // Arrange
104104 var memoryStream = new MemoryStream ( ) ;
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >netcoreapp3.1</TargetFramework >
4+ <TargetFramework >net7.0</TargetFramework >
5+ <Nullable >enable</Nullable >
56
67 <IsPackable >false</IsPackable >
78
1112 </PropertyGroup >
1213
1314 <ItemGroup >
14- <PackageReference Include =" FluentAssertions" Version =" 5.10.3 " />
15- <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.9.4 " />
16- <PackageReference Include =" Moq" Version =" 4.16.1 " />
17- <PackageReference Include =" xunit" Version =" 2.4.1 " />
18- <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.4 .3" >
15+ <PackageReference Include =" FluentAssertions" Version =" 6.12.0 " />
16+ <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.7.2 " />
17+ <PackageReference Include =" Moq" Version =" 4.20.69 " />
18+ <PackageReference Include =" xunit" Version =" 2.5.3 " />
19+ <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.5 .3" >
1920 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
2021 <PrivateAssets >all</PrivateAssets >
2122 </PackageReference >
22- <PackageReference Include =" coverlet.collector" Version =" 3 .0.3 " >
23+ <PackageReference Include =" coverlet.collector" Version =" 6 .0.0 " >
2324 <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
2425 <PrivateAssets >all</PrivateAssets >
2526 </PackageReference >
Original file line number Diff line number Diff line change 2222* SOFTWARE.
2323*/
2424
25- using RfmUsb ;
25+ using RfmUsb . Net ;
2626using System ;
2727using System . IO ;
2828
@@ -40,8 +40,8 @@ public interface IOtaService : IDisposable
4040 /// <param name="stream">The stream for the hex file to upload to the device</param>
4141 /// <param name="crc">The crc calculated for the uploaded flash image</param>
4242 /// <returns>true if the update succeeds</returns>
43- /// <remarks>The <see cref="IOtaService"/> depends on an <see cref="IRfmUsb "/> instance to transmit and receive packets.
44- /// The containing application must open and close the <see cref="IRfmUsb "/> instance.</remarks>
45- bool OtaUpdate ( int outputPower , Stream stream , out uint crc ) ;
43+ /// <remarks>The <see cref="IOtaService"/> depends on an <see cref="IRfm69 "/> instance to transmit and receive packets.
44+ /// The containing application must open and close the <see cref="IRfm69 "/> instance.</remarks>
45+ bool OtaUpdate ( sbyte outputPower , Stream stream , out uint crc ) ;
4646 }
4747}
You can’t perform that action at this time.
0 commit comments