예제 #1
0
 public void DoubleConversion_AlphabeticLetters_TheSameLetters()
 {
     foreach (var sample in Samples)
     {
         Assert.Equal(sample.Letters, AlphabetConverter.IntToLetters((int)AlphabetConverter.LettersToInt(sample.Letters)));
     }
 }
예제 #2
0
 public void IntToLetters_Number_ExpectedAlphabetLetters()
 {
     foreach (var sample in Samples)
     {
         Assert.Equal(sample.Letters, AlphabetConverter.IntToLetters(sample.Number));
     }
 }
예제 #3
0
            public string GetValue(int column, int row)
            {
                if (column == 1 && row == 1)
                {
                    return("/");
                }

                if (row == 1)
                {
                    return(AlphabetConverter.IntToLetters(column - 1));
                }

                if (column == 1)
                {
                    return((row - 1).ToString());
                }

                var value = View.GetValue(column - 1, row - 1);

                if (value == null)
                {
                    return(string.Empty);
                }

                return(_original ? value.OriginalValue : value.ResultValue);
            }
예제 #4
0
 public static string CoordinatesToKey(int column, int row)
 {
     return(AlphabetConverter.IntToLetters(column) + row);
 }
예제 #5
0
 public void IntToLetters_NegativeNumber_ThrowIndexOutOfRangeException(int number)
 {
     Assert.Throws <IndexOutOfRangeException>(() => AlphabetConverter.IntToLetters(number));
 }
예제 #6
0
 public void IntToLetters_Zero_ThrowIndexOutOfRangeException()
 {
     Assert.Throws <IndexOutOfRangeException>(() => AlphabetConverter.IntToLetters(0));
 }