コード例 #1
0
        [InlineData("", 10, "0")]       // emptiness equal to 0
        public void ConvertIntegerPartToAnySystem_ConvertIntegerNumberFromDecimalToRandomNumberSystem_Should_ConvertCorrectly(string number, int system, string expected)
        {
            /*Act*/
            string actual = NumberConverter.ConvertIntegerPartToAnySystem(number, system);

            /*Assert*/
            Assert.Equal(expected, actual);
        }
コード例 #2
0
 [InlineData("1C113")]   // used char from alphabet is bigger than decimal number system
 public void ConvertIntegerPartToAnySystem_TryToConvertInvalidNumber_Should_ThrowArgumentException(string number)
 {
     /*Assert*/
     Assert.Throws <ArgumentException>(() => NumberConverter.ConvertIntegerPartToAnySystem(number, NumberConverter.Decimal));
 }
コード例 #3
0
 [InlineData(42)]    // far from the boundary
 public void ConvertIntegerPartToAnySystem_TryToConvertDataToInvalidNumberSystem_Should_ThrowIndexOutOfRangeException(int system)
 {
     /*Assert*/
     Assert.Throws <IndexOutOfRangeException>(() => NumberConverter.ConvertIntegerPartToAnySystem(string.Empty, system));
 }