Skip to content

Commit 9144b47

Browse files
committed
Removed code warnings
Updated RfmUsb version
1 parent a17c8b1 commit 9144b47

File tree

7 files changed

+193
-183
lines changed

7 files changed

+193
-183
lines changed

RfmOta.UnitTests/OtaServiceTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
using Moq;
2929
using RfmOta.Exceptions;
3030
using RfmOta.Factory;
31-
using RfmUsb;
31+
using RfmUsb.Net;
3232
using System;
3333
using System.Collections.Generic;
3434
using 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();

RfmOta.UnitTests/RfmOta.UnitTests.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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

@@ -11,15 +12,15 @@
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>

RfmOta/IOtaService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* SOFTWARE.
2323
*/
2424

25-
using RfmUsb;
25+
using RfmUsb.Net;
2626
using System;
2727
using 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
}

0 commit comments

Comments
 (0)