示例#1
0
        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);
        }
示例#2
0
        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);
        }