Skip to content

Commit de8bae2

Browse files
authored
Merge pull request #129 from OpenIPC/dev
move ping message to Debug writeline, fix FirmwareTab unit test
2 parents 17bfd50 + 24f31f9 commit de8bae2

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

OpenIPC_Config.Tests/ViewModels/FirmwareTabViewModelTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class FirmwareTabViewModelTests
1717
private Mock<ISshClientService> _mockSshClientService;
1818
private Mock<IEventSubscriptionService> _mockEventSubscriptionService;
1919
private Mock<IGitHubService> _mockGithubService;
20+
private Mock<IMessageBoxService> _mockMessageBoxService;
2021

2122
[SetUp]
2223
public void Setup()
@@ -26,13 +27,15 @@ public void Setup()
2627

2728
_mockSshClientService = new Mock<ISshClientService>();
2829
_mockEventSubscriptionService = new Mock<IEventSubscriptionService>();
29-
_mockGithubService = new Mock<IGitHubService>();
30+
_mockGithubService = new Mock<IGitHubService>();
31+
_mockMessageBoxService = new Mock<IMessageBoxService>();
3032

3133
_viewModel = new FirmwareTabViewModel(
3234
_mockLogger.Object,
3335
_mockSshClientService.Object,
3436
_mockEventSubscriptionService.Object,
35-
_mockGithubService.Object);
37+
_mockGithubService.Object,
38+
_mockMessageBoxService.Object);
3639
}
3740

3841

OpenIPC_Config/ViewModels/FirmwareTabViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public partial class FirmwareTabViewModel : ViewModelBase
4242
private readonly IGitHubService _gitHubService;
4343
private bool _bInitializedCommands = false;
4444
private bool _bRecursionSelectGuard = false;
45-
IMessageBoxService _messageBoxService;
45+
private readonly IMessageBoxService _messageBoxService;
4646
#endregion
4747

4848
#region Observable Properties

OpenIPC_Config/ViewModels/MainViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ private async void PingTimer_Tick(object? sender, EventArgs e)
380380
// Only update the UI state if the IP we pinged is still the current IP
381381
if (ipBeingPinged == IpAddress)
382382
{
383-
_logger.Error(pingEx, $"Error occurred during ping to {ipBeingPinged}");
383+
Debug.WriteLine(pingEx, $"Error occurred during ping to {ipBeingPinged}");
384384
IsConnected = false;
385385
IsWaiting = true;
386386
_logger.Verbose("Current state after exception: IsConnected=False, IsWaiting=True");
@@ -391,7 +391,7 @@ private async void PingTimer_Tick(object? sender, EventArgs e)
391391
}
392392
}
393393

394-
_logger.Verbose($"After ping to {ipBeingPinged}: IsConnected={IsConnected}, IsWaiting={IsWaiting}");
394+
Debug.WriteLine($"After ping to {ipBeingPinged}: IsConnected={IsConnected}, IsWaiting={IsWaiting}");
395395
}
396396
catch (Exception ex)
397397
{

0 commit comments

Comments
 (0)