Repository navigation
Description
π€ This is an automated contribution from Repo Assist.
Summary
Adds a WindowsEdgeLight.Tests xUnit project that comprehensively tests all 8 properties of AppSettings. Previous test branches only covered ExcludeFromCapture β this branch covers the complete property set including the newer Brightness, ColorTemperature, IsLightOn, and UI-visibility properties.
Changes
WindowsEdgeLight.Tests/WindowsEdgeLight.Tests.csprojβ new test project (net8.0, xUnit 2.9.2); linksAppSettings.csdirectly (no WPF dependency)WindowsEdgeLight.Tests/AppSettingsTests.csβ 32 testsWindowsEdgeLight/AppSettings.csβSettingsFilePathchanged fromprivate static readonlyβinternal staticfor test isolation; addInternalsVisibleTo("WindowsEdgeLight.Tests")WindowsEdgeLight.slnβ test project added to solution
Test Coverage (32 tests, all green)
| Area | Tests |
|---|---|
| Default values for all 8 properties | 2 |
| Boolean round-trips (ExcludeFromCapture, IsLightOn, Show* Γ4) | 6 |
Double round-trips with [Theory] β Brightness (4 values) |
4 |
Double round-trips with [Theory] β ColorTemperature (4 values) |
4 |
| All-properties-together round-trip | 1 |
| File creation & directory auto-creation | 3 |
| Error recovery: corrupted / empty / null JSON | 4 |
| Forward-compatibility (unknown JSON properties) | 1 |
| JSON format tolerance (trailing commas, comments) | 2 |
| Consistency / idempotency | 3 |
| Sub-total | 32 |
Why the AppSettings.cs modification is safe
Changing private static readonly string β internal static string is semantically equivalent for production code (no callers outside the class modify it). The internal accessor is only used in tests, guarded by InternalsVisibleTo.
Test Status
Passed! - Failed: 0, Passed: 32, Skipped: 0, Total: 32
Tested on Linux (net8.0). No Windows or WPF required.
Closes (partially) the test-coverage gap highlighted in the monthly activity issue.
Note
π Integrity filter blocked 1 item
The following item were blocked because they don't meet the GitHub integrity level.
- Detect camera is being used by another application and automatically turn onΒ #21
list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
To allow these resources, lower min-integrity in your GitHub frontmatter:
tools:
github:
min-integrity: approved # merged | approved | unapproved | noneGenerated by Repo Assist Β· β 3.5M Β· β·
To install this agentic workflow, run
gh aw add githubnext/agentics/workflows/repo-assist.md@cbb46ab386962aa371045839fc9998ee4e97ca64
Note
This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch repo-assist/test-appsettings-allprops-2026-07-09-1ca9e945d425148c.
To fix the permissions issue, go to Settings β Actions β General and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ
Show patch preview (488 of 488 lines)
From 7087ee304f0c9bdceb2203ab99fa7b4783d3b8ea Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Thu, 9 Jul 2026 01:24:11 +0000
Subject: [PATCH] test: add comprehensive xUnit test project for AppSettings
(32 tests, all green)
- Add WindowsEdgeLight.Tests project targeting net8.0
- Link AppSettings.cs as compiled source (no WPF/WinForms dependency)
- 32 tests covering all 8 AppSettings properties:
- ExcludeFromCapture, IsLightOn, Brightness, ColorTemperature
- ShowToggleButton, ShowBrightnessButtons, ShowColorTempButtons, ShowMonitorControlButtons
- Tests: defaults, round-trip (all properties), all-properties-together,
file creation, error recovery (corrupted/empty/null JSON),
forward-compatibility, JSON format tolerance (comments, trailing commas),
consistency and idempotency
- Make AppSettings.SettingsFilePath internal (non-readonly) for test isolation
- Add InternalsVisibleTo for test project
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
WindowsEdgeLight.Tests/AppSettingsTests.cs | 344 ++++++++++++++++++
.../WindowsEdgeLight.Tests.csproj | 24 ++
WindowsEdgeLight.sln | 27 ++
WindowsEdgeLight/AppSettings.cs | 6 +-
4 files changed, 400 insertions(+), 1 deletion(-)
create mode 100644 WindowsEdgeLight.Tests/AppSettingsTests.cs
create mode 100644 WindowsEdgeLight.Tests/WindowsEdgeLight.Tests.csproj
diff --git a/WindowsEdgeLight.Tests/AppSettingsTests.cs b/WindowsEdgeLight.Tests/AppSettingsTests.cs
new file mode 100644
index 0000000..55208ba
--- /dev/null
+++ b/WindowsEdgeLight.Tests/AppSettingsTests.cs
@@ -0,0 +1,344 @@
+using System;
+using System.IO;
+using System.Text.Json;
+using Xunit;
+
+namespace WindowsEdgeLight.Tests;
+
+/// <summary>
+/// All AppSettings tests run serially to safely override the static SettingsFilePath.
+/// </summary>
+[Collection("AppSettings")]
+public class AppSettingsTests : IDisp
... (truncated)
Activity
shanselman commentedon Aug 8, 2026
Superseded by the smaller successful test proposal in #160.