diff --git a/X10D.Tests/src/Drawing/ColorTests.cs b/X10D.Tests/src/Drawing/ColorTests.cs index d673af4..a7ecec9 100644 --- a/X10D.Tests/src/Drawing/ColorTests.cs +++ b/X10D.Tests/src/Drawing/ColorTests.cs @@ -16,6 +16,54 @@ public class ColorTests private static readonly Color Magenta = Color.FromArgb(255, 0, 255); private static readonly Color Yellow = Color.FromArgb(255, 255, 0); + [TestMethod] + public void Deconstruct_ShouldDeconstructColor_GivenColor() + { + (byte r, byte g, byte b) = Black; + Assert.AreEqual(0, r); + Assert.AreEqual(0, g); + Assert.AreEqual(0, b); + + (byte a, r, g, b) = Black; + Assert.AreEqual(255, a); + Assert.AreEqual(0, r); + Assert.AreEqual(0, g); + Assert.AreEqual(0, b); + + (r, g, b) = Red; + Assert.AreEqual(255, r); + Assert.AreEqual(0, g); + Assert.AreEqual(0, b); + + (a, r, g, b) = Red; + Assert.AreEqual(255, a); + Assert.AreEqual(255, r); + Assert.AreEqual(0, g); + Assert.AreEqual(0, b); + + (r, g, b) = Green; + Assert.AreEqual(0, r); + Assert.AreEqual(255, g); + Assert.AreEqual(0, b); + + (a, r, g, b) = Green; + Assert.AreEqual(255, a); + Assert.AreEqual(0, r); + Assert.AreEqual(255, g); + Assert.AreEqual(0, b); + + (r, g, b) = Blue; + Assert.AreEqual(0, r); + Assert.AreEqual(0, g); + Assert.AreEqual(255, b); + + (a, r, g, b) = Blue; + Assert.AreEqual(255, a); + Assert.AreEqual(0, r); + Assert.AreEqual(0, g); + Assert.AreEqual(255, b); + } + [TestMethod] public void GetClosestConsoleColor_ShouldReturnClosestColor_GivenValidColor() {