public void TestZeroLuminosity () { var color = new Color (0.1, 0.2, 0.3); color = color.AddLuminosity (-1); Assert.AreEqual (0, color.Luminosity); Assert.AreEqual (0, color.R); Assert.AreEqual (0, color.G); Assert.AreEqual (0, color.B); }
public void TestAddLuminosity () { var color = new Color (0.2); var brighter = color.AddLuminosity (0.2); Assert.That (brighter.Luminosity, Is.EqualTo (color.Luminosity + 0.2).Within (0.001)); color = Color.Default; Assert.Throws<InvalidOperationException> (() => color.AddLuminosity (0.2)); }