mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-10-16 23:49:19 +02:00
Show the eu07.ini key on every settings row
This commit is contained in:
37
StarterNG.Tests/SettingKeyCatalogTests.cs
Normal file
37
StarterNG.Tests/SettingKeyCatalogTests.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using StarterNG.Infrastructure.Settings;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
|
||||
public class SettingKeyCatalogTests
|
||||
{
|
||||
[Fact]
|
||||
public void A_clamped_key_is_annotated_with_its_default_and_range()
|
||||
{
|
||||
Assert.Equal("dynamiclights = 7 (0-7)", SettingKeyCatalog.Annotate("dynamiclights"));
|
||||
Assert.Equal("starter.bufferscale = 100 (50-200)", SettingKeyCatalog.Annotate("starter.bufferscale"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void An_unclamped_key_is_annotated_with_its_default_alone()
|
||||
{
|
||||
Assert.Equal("maxtexturesize = 4096", SettingKeyCatalog.Annotate("maxtexturesize"));
|
||||
Assert.Equal("vsync = false", SettingKeyCatalog.Annotate("vsync"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_composite_or_unknown_key_is_shown_as_written()
|
||||
{
|
||||
Assert.Equal("shadowtune", SettingKeyCatalog.Annotate("shadowtune"));
|
||||
Assert.Equal("", SettingKeyCatalog.Annotate(null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void The_annotation_matches_what_the_serializer_actually_defaults_to()
|
||||
{
|
||||
var settings = new StarterNG.Domain.Settings.SimulatorSettings();
|
||||
new SettingsSerializer().Read(settings, new StarterNG.Classes.ConfigFile());
|
||||
|
||||
Assert.Equal($"maxtexturesize = {settings.MaxTextureSize}", SettingKeyCatalog.Annotate("maxtexturesize"));
|
||||
Assert.Equal($"fieldofview = {settings.FieldOfView} (15-75)", SettingKeyCatalog.Annotate("fieldofview"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user