feat(i18n): add Language preference and Save() to AppSettings
This commit is contained in:
22
tests/ClaudeDo.Ui.Tests/AppSettingsTests.cs
Normal file
22
tests/ClaudeDo.Ui.Tests/AppSettingsTests.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Text.Json;
|
||||
using ClaudeDo.Ui;
|
||||
|
||||
namespace ClaudeDo.Ui.Tests;
|
||||
|
||||
public class AppSettingsTests
|
||||
{
|
||||
[Fact]
|
||||
public void Language_defaults_to_empty()
|
||||
{
|
||||
Assert.Equal("", new AppSettings().Language);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Language_round_trips_through_json()
|
||||
{
|
||||
var json = JsonSerializer.Serialize(new AppSettings { Language = "de" });
|
||||
var back = JsonSerializer.Deserialize<AppSettings>(json,
|
||||
new JsonSerializerOptions { PropertyNameCaseInsensitive = true })!;
|
||||
Assert.Equal("de", back.Language);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user