Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions doc/GeneralUpdate.Drivelution.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ using GeneralUpdate.Drivelution.Abstractions.Configuration;
using GeneralUpdate.Drivelution.Abstractions.Models;

// Configure options
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
LogLevel = "Debug",
LogFilePath = "./Logs/driver-update-.log",
LogFilePath = "./Logs/drivelution-.log",
EnableConsoleLogging = true,
EnableFileLogging = true,
DefaultBackupPath = "./Backups",
Expand Down Expand Up @@ -272,7 +272,7 @@ var driverInfo = new DriverInfo
#### GPG Signature Validation
```csharp
// Linux drivers can be validated using GPG signatures
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
TrustedGpgKeys = new List<string>
{
Expand Down Expand Up @@ -531,10 +531,10 @@ var updater = GeneralDrivelution.Create();
### Custom Logging Configuration

```csharp
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
LogLevel = "Debug", // Verbose logging
LogFilePath = "./Logs/driver-update-.log", // Rolling file logs
LogFilePath = "./Logs/drivelution-.log", // Rolling file logs
EnableConsoleLogging = true, // Console output
EnableFileLogging = true // File output
};
Expand Down Expand Up @@ -707,7 +707,7 @@ catch (OperationCanceledException)
### 5. Log Everything

```csharp
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
LogLevel = "Info", // Use Info level in production
EnableFileLogging = true, // Keep file logs for auditing
Expand All @@ -718,7 +718,7 @@ var options = new DriverUpdateOptions
### 6. Clean Up Old Backups

```csharp
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
AutoCleanupBackups = true, // Enable automatic cleanup
BackupsToKeep = 5 // Keep last 5 backups
Expand Down Expand Up @@ -751,7 +751,7 @@ var strategy = new UpdateStrategy
```csharp
public async Task<bool> PerformSilentUpdateAsync(DriverInfo driverInfo)
{
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
EnableConsoleLogging = false, // No console output
EnableFileLogging = true, // Log to file
Expand Down Expand Up @@ -919,7 +919,7 @@ sudo ./YourApp
**Solution**:
```csharp
// Enable detailed logging to identify the specific validation failure
var options = new DriverUpdateOptions { LogLevel = "Debug" };
var options = new DrivelutionOptions { LogLevel = "Debug" };
var updater = GeneralDrivelution.Create(options);

// Try validation separately
Expand Down Expand Up @@ -1060,10 +1060,10 @@ var strategy = new UpdateStrategy

```csharp
// Create updater with default options
IGeneralDrivelution Create(DriverUpdateOptions? options = null)
IGeneralDrivelution Create(DrivelutionOptions? options = null)

// Create updater with custom logger
IGeneralDrivelution Create(ILogger logger, DriverUpdateOptions? options = null)
IGeneralDrivelution Create(ILogger logger, DrivelutionOptions? options = null)

// Quick update with default settings
Task<UpdateResult> QuickUpdateAsync(DriverInfo driverInfo, CancellationToken cancellationToken = default)
Expand Down
40 changes: 20 additions & 20 deletions src/c#/DrivelutionTest/Core/DriverUpdaterFactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
namespace DrivelutionTest.Core;

/// <summary>
/// Tests for DriverUpdaterFactory class.
/// Tests for DrivelutionFactory class.
/// Validates platform detection, factory creation, and platform-specific implementations.
/// </summary>
public class DriverUpdaterFactoryTests
public class DrivelutionFactoryTests
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test file name (DriverUpdaterFactoryTests.cs) no longer matches the renamed test class DrivelutionFactoryTests. Renaming the file to DrivelutionFactoryTests.cs will keep test discovery/navigation consistent with the rest of the test project.

Suggested change
public class DrivelutionFactoryTests
public class DriverUpdaterFactoryTests

Copilot uses AI. Check for mistakes.
{
/// <summary>
/// Tests that Create method returns a non-null instance.
Expand All @@ -19,7 +19,7 @@ public class DriverUpdaterFactoryTests
public void Create_WithoutParameters_ReturnsNonNullInstance()
{
// Arrange & Act
var updater = DriverUpdaterFactory.Create();
var updater = DrivelutionFactory.Create();

// Assert
Assert.NotNull(updater);
Expand All @@ -39,7 +39,7 @@ public void Create_WithCustomLogger_ReturnsInstance()
.CreateLogger();

// Act
var updater = DriverUpdaterFactory.Create(logger);
var updater = DrivelutionFactory.Create(logger);

// Assert
Assert.NotNull(updater);
Expand All @@ -53,14 +53,14 @@ public void Create_WithCustomLogger_ReturnsInstance()
public void Create_WithCustomOptions_ReturnsInstance()
{
// Arrange
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
LogLevel = "Debug",
LogFilePath = "./logs/test.log"
};

// Act
var updater = DriverUpdaterFactory.Create(null, options);
var updater = DrivelutionFactory.Create(null, options);

// Assert
Assert.NotNull(updater);
Expand All @@ -73,7 +73,7 @@ public void Create_WithCustomOptions_ReturnsInstance()
public void GetCurrentPlatform_ReturnsValidPlatformName()
{
// Act
var platform = DriverUpdaterFactory.GetCurrentPlatform();
var platform = DrivelutionFactory.GetCurrentPlatform();

// Assert
Assert.NotNull(platform);
Expand All @@ -87,11 +87,11 @@ public void GetCurrentPlatform_ReturnsValidPlatformName()
public void IsPlatformSupported_ReturnsBooleanValue()
{
// Act
var isSupported = DriverUpdaterFactory.IsPlatformSupported();
var isSupported = DrivelutionFactory.IsPlatformSupported();

// Assert
// Windows and Linux should be supported
Assert.True(isSupported || DriverUpdaterFactory.GetCurrentPlatform() == "MacOS" || DriverUpdaterFactory.GetCurrentPlatform() == "Unknown");
Assert.True(isSupported || DrivelutionFactory.GetCurrentPlatform() == "MacOS" || DrivelutionFactory.GetCurrentPlatform() == "Unknown");
}

/// <summary>
Expand All @@ -101,14 +101,14 @@ public void IsPlatformSupported_ReturnsBooleanValue()
public void CreateValidator_WithoutLogger_ReturnsNonNullInstance()
{
// Skip on MacOS and Unknown platforms
var platform = DriverUpdaterFactory.GetCurrentPlatform();
var platform = DrivelutionFactory.GetCurrentPlatform();
if (platform == "MacOS" || platform == "Unknown")
{
return;
}

// Act
var validator = DriverUpdaterFactory.CreateValidator();
var validator = DrivelutionFactory.CreateValidator();

// Assert
Assert.NotNull(validator);
Expand All @@ -122,14 +122,14 @@ public void CreateValidator_WithoutLogger_ReturnsNonNullInstance()
public void CreateBackup_WithoutLogger_ReturnsNonNullInstance()
{
// Skip on MacOS and Unknown platforms
var platform = DriverUpdaterFactory.GetCurrentPlatform();
var platform = DrivelutionFactory.GetCurrentPlatform();
if (platform == "MacOS" || platform == "Unknown")
{
return;
}

// Act
var backup = DriverUpdaterFactory.CreateBackup();
var backup = DrivelutionFactory.CreateBackup();

// Assert
Assert.NotNull(backup);
Expand All @@ -143,7 +143,7 @@ public void CreateBackup_WithoutLogger_ReturnsNonNullInstance()
public void CreateValidator_WithCustomLogger_ReturnsInstance()
{
// Skip on MacOS and Unknown platforms
var platform = DriverUpdaterFactory.GetCurrentPlatform();
var platform = DrivelutionFactory.GetCurrentPlatform();
if (platform == "MacOS" || platform == "Unknown")
{
return;
Expand All @@ -156,7 +156,7 @@ public void CreateValidator_WithCustomLogger_ReturnsInstance()
.CreateLogger();

// Act
var validator = DriverUpdaterFactory.CreateValidator(logger);
var validator = DrivelutionFactory.CreateValidator(logger);

// Assert
Assert.NotNull(validator);
Expand All @@ -169,7 +169,7 @@ public void CreateValidator_WithCustomLogger_ReturnsInstance()
public void CreateBackup_WithCustomLogger_ReturnsInstance()
{
// Skip on MacOS and Unknown platforms
var platform = DriverUpdaterFactory.GetCurrentPlatform();
var platform = DrivelutionFactory.GetCurrentPlatform();
if (platform == "MacOS" || platform == "Unknown")
{
return;
Expand All @@ -182,7 +182,7 @@ public void CreateBackup_WithCustomLogger_ReturnsInstance()
.CreateLogger();

// Act
var backup = DriverUpdaterFactory.CreateBackup(logger);
var backup = DrivelutionFactory.CreateBackup(logger);

// Assert
Assert.NotNull(backup);
Expand All @@ -196,17 +196,17 @@ public void CreateBackup_WithCustomLogger_ReturnsInstance()
public void Create_OnSupportedPlatform_DoesNotThrow()
{
// Skip on MacOS as it's not yet implemented
var platform = DriverUpdaterFactory.GetCurrentPlatform();
var platform = DrivelutionFactory.GetCurrentPlatform();

if (platform == "MacOS")
{
// MacOS should throw PlatformNotSupportedException
Assert.Throws<PlatformNotSupportedException>(() => DriverUpdaterFactory.Create());
Assert.Throws<PlatformNotSupportedException>(() => DrivelutionFactory.Create());
return;
}

// Act & Assert - should not throw on Windows/Linux
var exception = Record.Exception(() => DriverUpdaterFactory.Create());
var exception = Record.Exception(() => DrivelutionFactory.Create());
Assert.Null(exception);
}
}
4 changes: 2 additions & 2 deletions src/c#/DrivelutionTest/GeneralDrivelutionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void Create_WithoutParameters_ReturnsNonNullInstance()
public void Create_WithOptions_ReturnsNonNullInstance()
{
// Arrange
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
LogLevel = "Information",
LogFilePath = "./logs/test.log"
Expand Down Expand Up @@ -74,7 +74,7 @@ public void Create_WithCustomLoggerAndOptions_ReturnsInstance()
.MinimumLevel.Debug()
.WriteTo.Console()
.CreateLogger();
var options = new DriverUpdateOptions
var options = new DrivelutionOptions
{
LogLevel = "Debug"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace GeneralUpdate.Drivelution.Abstractions.Configuration;
/// 驱动更新配置选项
/// Driver update configuration options
/// </summary>
public class DriverUpdateOptions
public class DrivelutionOptions
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name (DriverUpdateOptions.cs) no longer matches the public type it contains (DrivelutionOptions). To stay consistent with the rest of the project’s one-type-per-file naming (e.g., Abstractions/Models/DriverInfo.cs), consider renaming the file to DrivelutionOptions.cs.

Copilot uses AI. Check for mistakes.
{
/// <summary>
/// 默认备份路径
Expand All @@ -22,7 +22,7 @@ public class DriverUpdateOptions
/// 日志文件路径
/// Log file path
/// </summary>
public string LogFilePath { get; set; } = "./Logs/driver-update-.log";
public string LogFilePath { get; set; } = "./Logs/drivelution-.log";

/// <summary>
/// 是否启用控制台日志
Expand Down
Loading
Loading