public void ToAlpha_TestAllSingleDigits() { // Arrange for (int n = 0; n < 26; n++) { string expected = symbol[n].ToString(); // Act string result = IntegerToAlphabet.ToAlpha(n, ""); // Assert Assert.AreEqual(expected, result); } }
public void ToAlphaTestCBX() { // C B X = C * (26^2) + B * (26^1) + X * (26^0) // = 2 * 676 + 1 * 26 + 23 * 1 // = 1352 + 26 + 23 // = 1401 // Arrange int n = 1401; string expected = "CBX"; // Act string result = IntegerToAlphabet.ToAlpha(n, ""); // Assert Assert.AreEqual(expected, result); }