style: expand one-line summaries and run dotnet format solution-wide

This commit is contained in:
yyc12345 committed 2026-10-04 10:22:02 +08:00
1 parent 9ea551b600
commit 8b7e50a955
95 files changed
+970 -1424

No files matched your search

+9 -18
View File
@@ -7,11 +7,9 @@ namespace YKanBan.Tests.Models;
/// boundary in both directions.
/// </summary>
[TestClass]
public class RgbColorTests
{
public class RgbColorTests {
[TestMethod]
public void ParseSplitsComponents()
{
public void ParseSplitsComponents() {
RgbColor color = RgbColor.Parse("#102030");
Assert.AreEqual((byte)0x10, color.R);
Assert.AreEqual((byte)0x20, color.G);
@@ -22,8 +20,7 @@ public class RgbColorTests
[DataRow("#a1B2c3")]
[DataRow("#A1B2C3")]
[DataRow("#a1b2c3")]
public void ParseIsCaseInsensitive(string text)
{
public void ParseIsCaseInsensitive(string text) {
Assert.AreEqual(new RgbColor(0xA1, 0xB2, 0xC3), RgbColor.Parse(text));
}
@@ -36,41 +33,35 @@ public class RgbColorTests
[DataRow("#12345g")]
[DataRow(" #112233")]
[DataRow("#112233 ")]
public void ParseRejectsMalformedText(string text)
{
public void ParseRejectsMalformedText(string text) {
Assert.ThrowsExactly<FormatException>(() => RgbColor.Parse(text));
}
[TestMethod]
public void TryParseRejectsNull()
{
public void TryParseRejectsNull() {
Assert.IsFalse(RgbColor.TryParse(null, out RgbColor color));
Assert.AreEqual(default, color);
}
[TestMethod]
public void TryParseAcceptsValidText()
{
public void TryParseAcceptsValidText() {
Assert.IsTrue(RgbColor.TryParse("#010203", out RgbColor color));
Assert.AreEqual(new RgbColor(1, 2, 3), color);
}
[TestMethod]
public void ToStringUsesCanonicalLowercase()
{
public void ToStringUsesCanonicalLowercase() {
Assert.AreEqual("#ff0a00", new RgbColor(0xFF, 0x0A, 0x00).ToString());
}
[TestMethod]
public void TextRoundTrips()
{
public void TextRoundTrips() {
var color = new RgbColor(0x12, 0xAB, 0xCD);
Assert.AreEqual(color, RgbColor.Parse(color.ToString()));
}
[TestMethod]
public void EqualityComparesComponents()
{
public void EqualityComparesComponents() {
Assert.AreEqual(new RgbColor(1, 2, 3), new RgbColor(1, 2, 3));
Assert.AreNotEqual(new RgbColor(1, 2, 3), new RgbColor(1, 2, 4));
}