예제 #1
0
        public void ColorFromComponentsTest()
        {
            Core.Color color = (255, 120, 13, 1);

            Assert.AreEqual(255, color.GetA(), $"A doesn't equal the used component. ({color.GetA()} != 255)");
            Assert.AreEqual(120, color.GetR(), $"R doesn't equal the used component. ({color.GetR()} != 120)");
            Assert.AreEqual(13, color.GetG(), $"G doesn't equal the used component. ({color.GetG()} != 13)");
            Assert.AreEqual(1, color.GetB(), $"B doesn't equal the used component. ({color.GetB()} != 1)");
        }
예제 #2
0
        public void ARGBIntConstructorTest()
        {
            Core.Color color = new Core.Color(200, 10, 120, 255);

            Assert.AreEqual(200, color.GetA(), "A is not 200");
            Assert.AreEqual(10, color.GetR(), "R is not 10");
            Assert.AreEqual(120, color.GetG(), "G is not 120");
            Assert.AreEqual(255, color.GetB(), "B is not 255");
        }
예제 #3
0
        public void RGBByteConstructorTest()
        {
            Core.Color color = new Core.Color((byte)10, (byte)120, (byte)255);

            Assert.AreEqual(255, color.GetA(), "A is not 255");
            Assert.AreEqual(10, color.GetR(), "R is not 10");
            Assert.AreEqual(120, color.GetG(), "G is not 120");
            Assert.AreEqual(255, color.GetB(), "B is not 255");
        }
예제 #4
0
        public void VerifyTransparent()
        {
            Core.Color transparent = Core.Color.Transparent;

            Assert.AreEqual(0, transparent.GetA(), "A is not 0");
            Assert.AreEqual(0, transparent.GetR(), "R is not 0");
            Assert.AreEqual(0, transparent.GetG(), "G is not 0");
            Assert.AreEqual(0, transparent.GetB(), "B is not 0");
        }
예제 #5
0
        public void CloneConstructorTest()
        {
            Core.Color referennceColor = new Core.Color(200, 10, 120, 255);
            Core.Color color           = new Core.Color(referennceColor);

            Assert.AreEqual(200, color.GetA(), "A is not 200");
            Assert.AreEqual(10, color.GetR(), "R is not 10");
            Assert.AreEqual(120, color.GetG(), "G is not 120");
            Assert.AreEqual(255, color.GetB(), "B is not 255");
        }
예제 #6
0
        public void ARGBIntConstructorClampTest()
        {
            Core.Color color = new Core.Color(256, 256, 256, 256);

            Assert.AreEqual(255, color.GetA(), "A is not 255");
            Assert.AreEqual(255, color.GetR(), "R is not 255");
            Assert.AreEqual(255, color.GetG(), "G is not 255");
            Assert.AreEqual(255, color.GetB(), "B is not 255");

            Core.Color color2 = new Core.Color(-1, -1, -1, -1);

            Assert.AreEqual(0, color2.GetA(), "A is not 0");
            Assert.AreEqual(0, color2.GetR(), "R is not 0");
            Assert.AreEqual(0, color2.GetG(), "G is not 0");
            Assert.AreEqual(0, color2.GetB(), "B is not 0");
        }