fix text warns and explicitly target windows-2025-vs2026 for runners

This commit is contained in:
2026-06-12 11:48:08 -05:00
parent 1f56cc7ce5
commit 0bbf198668
5 changed files with 19 additions and 17 deletions
@@ -18,7 +18,7 @@ public class AppSettingsTests : IDisposable
// Use reflection to instantiate AppSettings with custom filename
var ctor = typeof(AppSettings).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(string) }, null);
_settings = (AppSettings)ctor.Invoke(new object[] { _tempFile });
_settings = (AppSettings)ctor!.Invoke(new object[] { _tempFile });
}
public void Dispose()
@@ -109,7 +109,7 @@ public class AppSettingsTests : IDisposable
// Create new instance pointing to same file
var ctor = typeof(AppSettings).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(string) }, null);
var loadedSettings = (AppSettings)ctor.Invoke(new object[] { _tempFile });
var loadedSettings = (AppSettings)ctor!.Invoke(new object[] { _tempFile });
loadedSettings.Load();
@@ -221,6 +221,7 @@ public class SensorFormatterTests
mockSensor.Setup(s => s.SensorType).Returns(SensorType.Temperature);
var result = SensorFormatter.GetPlotValue(mockSensor.Object, TemperatureUnit.Fahrenheit);
Assert.NotNull(result);
Assert.Equal(77.9, result.Value, 1);
}
@@ -243,6 +244,7 @@ public class SensorFormatterTests
var result = SensorFormatter.GetPlotValue(mockSensor.Object, 25.5f, TemperatureUnit.Fahrenheit);
Assert.NotNull(result);
Assert.Equal(77.9, result.Value, 1);
}
@@ -11,7 +11,7 @@ public class SimpleViewModelsTests
{
private class TestViewModel : ViewModelBase
{
private string _testProperty;
private string _testProperty = string.Empty;
public string TestProperty
{
get => _testProperty;
@@ -28,7 +28,7 @@ public class SimpleViewModelsTests
public void ViewModelBase_SetProperty_ChangesValueAndRaisesEvent()
{
var vm = new TestViewModel();
string changedProperty = null;
string? changedProperty = null;
vm.PropertyChanged += (sender, args) => changedProperty = args.PropertyName;
// Change value
@@ -57,7 +57,7 @@ public class SimpleViewModelsTests
public void ViewModelBase_OnPropertyChanged_RaisesEvent()
{
var vm = new TestViewModel();
string changedProperty = null;
string? changedProperty = null;
vm.PropertyChanged += (sender, args) => changedProperty = args.PropertyName;
vm.TriggerPropertyChanged("CustomProperty");