public void openKeypad() { puzzle.animator.SetBool("KeypadOpen", true); puzzle.keypad.index = this.index; if (puzzle.successes[this.index]) { puzzle.keypad.correctLight.sprite = puzzle.lightImages[1]; } else { puzzle.keypad.correctLight.sprite = puzzle.lightImages[0]; } puzzle.keypad.enterButton.interactable = !puzzle.successes[this.index]; puzzle.keypad.resetButton.interactable = !puzzle.successes[this.index]; puzzle.keypad.value = puzzle.values[index]; puzzle.keypad.coordinateLabel = puzzle.coordinates[index]; if (CameraScript.Instance.wiresConnected) { puzzle.keypad.outputText.text = RomanNum.ToRoman(puzzle.keypad.value); puzzle.keypad.sideText.text = puzzle.coordinates[index] + "-COORD"; } else { puzzle.keypad.value = 0; puzzle.values[index] = 0; puzzle.keypad.outputText.text = ""; puzzle.keypad.sideText.text = ""; } }
public void numb_notEqual() { RomanNum a1 = new RomanNum(1); string s1 = a1.Roman; a1.Dec = 2; string s2 = a1.Roman; Assert.AreNotEqual(s1, s2); }
public void Test7() { //arrange RomanNum r = new RomanNum(); var expected = "VII"; //act var actual = r.ConvertToRoman(7); //assert Assert.AreEqual(expected, actual); }
public void Test3999() { //arrange RomanNum r = new RomanNum(); var expected = "MMMCMXCIX"; //act var actual = r.ConvertToRoman(3999); //assert Assert.AreEqual(expected, actual); }
public void roman_q_exeption() { string rom = "q"; try { int actual = RomanNum.ConvertToDec(rom); } catch (ExeptionRomanNumber ex) { Assert.AreEqual(string.Format(ExeptionRes.unsupportedChar, rom), ex.Message); } }
public void roman_xxxx_exeption() { string rom = "xxxx"; try { int actual = RomanNum.ConvertToDec(rom); } catch (ExeptionRomanNumber ex) { Assert.AreEqual(ExeptionRes.treeInARow, ex.Message); } }
public void decimal_4000_exeption() { int value = 4000; try { string actual = RomanNum.ConvertToRoman(value); } catch (ExeptionRomanNumber ex) { Assert.AreEqual(ExeptionRes.wrongRange, ex.Message); } }
public void roman_empty_exeption() { string rom = ""; try { int actual = RomanNum.ConvertToDec(rom); } catch (ExeptionRomanNumber ex) { Assert.AreEqual(ExeptionRes.nullOrEmpty, ex.Message); } }
public void roman_vx_exeption() { string rom = "vx"; try { int actual = RomanNum.ConvertToDec(rom); } catch (ExeptionRomanNumber ex) { Assert.AreEqual(ExeptionRes.wrong, ex.Message); } }
public void roman_ixiii_exeption() { string rom = "ixiii"; int dec = 12; string correctRom = "XII"; try { int actual = RomanNum.ConvertToDec(rom); } catch (ExeptionRomanNumber ex) { Assert.AreEqual(string.Format(ExeptionRes.IncorrectNumber, correctRom, dec, rom), ex.Message); } }
public void UpdateDisplay() { if (CameraScript.Instance.wiresConnected) { puzzle.values[this.index] = value; outputText.text = RomanNum.ToRoman(value); sideText.text = coordinateLabel + "-COORD"; thoughts.sentence = "Three keypads. They seem to be for inputting coordinates of some sort."; } else { thoughts.sentence = "Three keypads. They don't seem to be turned on."; value = 0; puzzle.values[index] = 0; outputText.text = ""; sideText.text = ""; } }
public void Test_Convert() { Dictionary <int, string> inputOutput = new Dictionary <int, string> { { 2000, "MM" }, { 2500, "MMD" }, { 500, "D" }, { 21, "XXI" }, { 24, "XXIV" }, { 4, "IV" }, { 44, "XLIV" }, { 88, "LXXXVIII" }, { 98, "XCVIII" } }; foreach (var KV in inputOutput) { var v = RomanNum.Convert(KV.Key); Assert.IsTrue(v == KV.Value, "{0} should convert to {1}, got {2} instead.", KV.Key, KV.Value, v); } }
public void updateText() { text.text = chemical + ": " + RomanNum.ToRoman(value); }
public void int_to_roman(int integerVersion, string romanVersion) { string actual = RomanNum.ConvertToRoman(integerVersion); Assert.AreEqual(romanVersion, actual); }
public void roman_to_int(int integerVersion, string romanVersion) { int actual = RomanNum.ConvertToDec(romanVersion); Assert.AreEqual(integerVersion, actual); }