From 215bea5326cb1de44db9ff07487072b1c1b3053f Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 28 Jan 2026 07:51:45 +0000
Subject: [PATCH 1/4] Initial plan
From 9d6cbb26cbc0bb85dee64ab5a35c3982c2fa880f Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 28 Jan 2026 07:57:51 +0000
Subject: [PATCH 2/4] Add comprehensive unit tests for GeneralUpdate.Core
Co-authored-by: JusterZhu <11714536+JusterZhu@users.noreply.github.com>
---
.../Bootstrap/GeneralUpdateBootstrapTests.cs | 210 ++++++++++++++++++
.../Bootstrap/GeneralUpdateOSSTests.cs | 40 ++++
src/c#/CoreTest/CoreTest.csproj | 26 +++
src/c#/CoreTest/Driver/DriverInfoTests.cs | 60 +++++
.../CoreTest/Driver/DriverInformationTests.cs | 132 +++++++++++
.../CoreTest/Driver/DriverProcessorTests.cs | 101 +++++++++
.../Pipeline/CompressMiddlewareTests.cs | 61 +++++
.../Pipeline/DriverMiddlewareTests.cs | 107 +++++++++
.../CoreTest/Pipeline/HashMiddlewareTests.cs | 126 +++++++++++
.../CoreTest/Pipeline/PatchMiddlewareTests.cs | 46 ++++
.../CoreTest/Strategys/LinuxStrategyTests.cs | 46 ++++
src/c#/CoreTest/Strategys/OSSStrategyTests.cs | 46 ++++
.../Strategys/WindowsStrategyTests.cs | 46 ++++
src/c#/GeneralUpdate.sln | 106 +++++++++
14 files changed, 1153 insertions(+)
create mode 100644 src/c#/CoreTest/Bootstrap/GeneralUpdateBootstrapTests.cs
create mode 100644 src/c#/CoreTest/Bootstrap/GeneralUpdateOSSTests.cs
create mode 100644 src/c#/CoreTest/CoreTest.csproj
create mode 100644 src/c#/CoreTest/Driver/DriverInfoTests.cs
create mode 100644 src/c#/CoreTest/Driver/DriverInformationTests.cs
create mode 100644 src/c#/CoreTest/Driver/DriverProcessorTests.cs
create mode 100644 src/c#/CoreTest/Pipeline/CompressMiddlewareTests.cs
create mode 100644 src/c#/CoreTest/Pipeline/DriverMiddlewareTests.cs
create mode 100644 src/c#/CoreTest/Pipeline/HashMiddlewareTests.cs
create mode 100644 src/c#/CoreTest/Pipeline/PatchMiddlewareTests.cs
create mode 100644 src/c#/CoreTest/Strategys/LinuxStrategyTests.cs
create mode 100644 src/c#/CoreTest/Strategys/OSSStrategyTests.cs
create mode 100644 src/c#/CoreTest/Strategys/WindowsStrategyTests.cs
diff --git a/src/c#/CoreTest/Bootstrap/GeneralUpdateBootstrapTests.cs b/src/c#/CoreTest/Bootstrap/GeneralUpdateBootstrapTests.cs
new file mode 100644
index 00000000..92481102
--- /dev/null
+++ b/src/c#/CoreTest/Bootstrap/GeneralUpdateBootstrapTests.cs
@@ -0,0 +1,210 @@
+using GeneralUpdate.Common.Download;
+using GeneralUpdate.Common.Internal;
+using GeneralUpdate.Common.Shared.Object;
+using GeneralUpdate.Core;
+using Xunit;
+
+namespace CoreTest.Bootstrap
+{
+ ///
+ /// Contains test cases for the GeneralUpdateBootstrap class.
+ /// Tests the main orchestrator for platform-agnostic update process.
+ ///
+ public class GeneralUpdateBootstrapTests
+ {
+ ///
+ /// Tests that GeneralUpdateBootstrap can be instantiated.
+ ///
+ [Fact]
+ public void Constructor_CreatesInstance()
+ {
+ // Act
+ var bootstrap = new GeneralUpdateBootstrap();
+
+ // Assert
+ Assert.NotNull(bootstrap);
+ }
+
+ ///
+ /// Tests that SetConfig returns the bootstrap instance for chaining.
+ ///
+ [Fact]
+ public void SetConfig_ReturnsBootstrapInstance()
+ {
+ // Arrange
+ var bootstrap = new GeneralUpdateBootstrap();
+ var configInfo = new Configinfo
+ {
+ InstallPath = "/test/install",
+ MainAppName = "TestApp.exe",
+ UpdateUrl = "https://example.com/update",
+ ClientVersion = "1.0.0"
+ };
+
+ // Act
+ var result = bootstrap.SetConfig(configInfo);
+
+ // Assert
+ Assert.Same(bootstrap, result);
+ }
+
+ ///
+ /// Tests that SetFieldMappings returns the bootstrap instance for chaining.
+ ///
+ [Fact]
+ public void SetFieldMappings_ReturnsBootstrapInstance()
+ {
+ // Arrange
+ var bootstrap = new GeneralUpdateBootstrap();
+ var fieldMappings = new Dictionary
+ {
+ { "field1", "value1" }
+ };
+
+ // Act
+ var result = bootstrap.SetFieldMappings(fieldMappings);
+
+ // Assert
+ Assert.Same(bootstrap, result);
+ }
+
+ ///
+ /// Tests that SetCustomSkipOption returns the bootstrap instance for chaining.
+ ///
+ [Fact]
+ public void SetCustomSkipOption_ReturnsBootstrapInstance()
+ {
+ // Arrange
+ var bootstrap = new GeneralUpdateBootstrap();
+ Func skipFunc = () => false;
+
+ // Act
+ var result = bootstrap.SetCustomSkipOption(skipFunc);
+
+ // Assert
+ Assert.Same(bootstrap, result);
+ }
+
+ ///
+ /// Tests that AddListenerMultiAllDownloadCompleted returns the bootstrap instance for chaining.
+ ///
+ [Fact]
+ public void AddListenerMultiAllDownloadCompleted_ReturnsBootstrapInstance()
+ {
+ // Arrange
+ var bootstrap = new GeneralUpdateBootstrap();
+ Action