public void GetClampedTest() { ColorRGB input = new ColorRGB(2.0f, -3.0f, 0.5f, 1.0f); ColorRGB expected = new ColorRGB(1.0f, 0.0f, 0.5f, 1.0f); ColorRGB actual = input.GetClamped(); Assert.AreEqual(expected, actual); }
public void GetClampedShouldEqualClamp() { ColorRGB input = new ColorRGB(1.5f, 0.4f, -51.5f, 0.0f); ColorRGB clamp = input.GetClamped(); input.Clamp(); bool expected = true; bool actual = clamp == input; Assert.AreEqual(expected, actual); }