Color schemes - unit test fixes

This commit is contained in:
Tig
2024-09-22 15:33:06 -06:00
parent c33736dfa6
commit 5861277b65
24 changed files with 389 additions and 261 deletions

View File

@@ -563,7 +563,7 @@ public class ConfigurationManagerTests
{
""UserDefined"": {
""hotNormal"": {
""foreground"": ""brown"",
""foreground"": ""brownish"",
""background"": ""1234""
}
}
@@ -575,7 +575,7 @@ public class ConfigurationManagerTests
}";
var jsonException = Assert.Throws<JsonException> (() => Settings!.Update (json, "test"));
Assert.Equal ("Unexpected color name: brown.", jsonException.Message);
Assert.Equal ("Unexpected color name: brownish.", jsonException.Message);
// AbNormal is not a ColorScheme attribute
json = @"

View File

@@ -67,7 +67,7 @@ public class ColorJsonConverterTests
Assert.Equal ($"\"{expectedJson}\"", serialized);
}
[Theory]
[Theory (Skip = "Not anymore. If a W3C color matches, that's used")]
[InlineData (0, 0, 0, "\"#000000\"")]
[InlineData (0, 0, 1, "\"#000001\"")]
public void SerializesToHexCode (int r, int g, int b, string expected)
@@ -118,7 +118,7 @@ public class ColorJsonConverterTests
{
// Arrange
var json = "\"Black\"";
var expectedColor = new Color (ColorName.Black);
var expectedColor = new Color ("Black");
// Act
var color = JsonSerializer.Deserialize<Color> (