Ejemplo n.º 1
0
        public IEnumerator TestTurningColorButtonsOff()
        {
            yield return(null);

            string pageOne = _world.SplitSheets(Utils.LoadText(level_path))[0];

            string[] rows = pageOne.Split(new[] { "\r\n", "\n" }, StringSplitOptions.None);

            string[]    cells = rows[0].Split(',');
            ColorButton cb    = GameObject.Find(cells[0]).GetComponent <ColorButton>();
            ColorScreen cs    = GameObject.Find(cells[1]).GetComponent <ColorScreen>();

            cb.Trigger();
            cb.Trigger();

            Assert.IsTrue(cs.GetColor() == Color.black);
        }
Ejemplo n.º 2
0
        public IEnumerator TestColorButtons()
        {
            yield return(null);

            string pageOne = _world.SplitSheets(Utils.LoadText(level_path))[0];

            string[] rows = pageOne.Split(new[] { "\r\n", "\n" }, StringSplitOptions.None);

            ColorScreen cs             = GameObject.Find(rows[0].Split(',')[1]).GetComponent <ColorScreen>();
            Color       predictedColor = new Color();

            for (int i = 0; i < rows.Length; i++)
            {
                string[]    cells = rows[i].Split(',');
                ColorButton cb    = GameObject.Find(cells[0]).GetComponent <ColorButton>();
                predictedColor += cb.GetColor();

                cb.Trigger();

                var testColor = new Color(Mathf.Min(predictedColor.r, 1), Mathf.Min(predictedColor.g, 1), Mathf.Min(predictedColor.b, 1));

                Assert.IsTrue(cs.GetColor() == testColor);
            }
        }