Example #1
0
        public void ensureChangeColorDoesNotChangeColorIfNewColorIsNull()
        {
            Color        color  = Color.valueOf("Azul", 1, 1, 1, 1);
            Finish       finish = Finish.valueOf("Acabamento polido", 12);
            List <Color> colors = new List <Color>();

            colors.Add(color);
            List <Finish> finishes = new List <Finish>();

            finishes.Add(finish);
            Material           material           = new Material("1234", "Material", "ola.jpg", colors, finishes);
            CustomizedMaterial customizedMaterial = CustomizedMaterial.valueOf(material, color, finish);

            Action act = () => customizedMaterial.changeColor(null);

            Assert.Throws <ArgumentException>(act);
            Assert.Equal(customizedMaterial.color, color);
        }
Example #2
0
        public void ensureChangeColorChangesColor()
        {
            Color        color      = Color.valueOf("Azul", 1, 1, 1, 1);
            Color        otherColor = Color.valueOf("Amarelo", 2, 2, 3, 3);
            Finish       finish     = Finish.valueOf("Acabamento polido", 12);
            List <Color> colors     = new List <Color>();

            colors.Add(color);
            colors.Add(otherColor);
            List <Finish> finishes = new List <Finish>();

            finishes.Add(finish);
            Material           material           = new Material("1234", "Material", "ola.jpg", colors, finishes);
            CustomizedMaterial customizedMaterial = CustomizedMaterial.valueOf(material, color, finish);

            Assert.True(customizedMaterial.changeColor(otherColor));
            Assert.NotEqual(customizedMaterial.color, color);
        }