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); }
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); } }
public static void MainMenu() { IScreen _screen = null; string consoleVal; string[] menuItems = new string[] { "1-Car Manager", "2-Brand Manager", "3-Color Manager", "4-User Manager", "5-Customer Manager", "6-Rental Manager", "7-Settings", "8-EXIT" }; ConsoleTexts.WriteConsoleMenuInFrame(Messages.MainMenuTitle, menuItems); consoleVal = ConsoleTexts.ConsoleWriteReadLine(Messages.SelectNumberOfMenuItem); if (consoleVal == "") { consoleVal = "0"; } int selected = Convert.ToInt32(consoleVal); switch (selected) { case 1: _screen = new CarScreen(GetCarManager().Data); break; case 2: _screen = new BrandScreen(GetBrandManager().Data); break; case 3: _screen = new ColorScreen(GetColorManager().Data); break; case 4: _screen = new UserScreen(GetUserManager().Data); break; case 5: _screen = new CustomerScreen(GetCustomerManager().Data); break; case 6: _screen = new RentalScreen(GetRentalManager().Data); break; case 7: //SettingMenu(); //MainMenu(); break; case 8: Environment.Exit(0); break; default: Console.WriteLine(Messages.WrongChoice); MainMenu(); break; } if (_screen != null) { _screen.Menu(); } MainMenu(); }