[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); }
[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)); }
[InlineData(42)] // far from the boundary public void ConvertIntegerPartToAnySystem_TryToConvertDataToInvalidNumberSystem_Should_ThrowIndexOutOfRangeException(int system) { /*Assert*/ Assert.Throws <IndexOutOfRangeException>(() => NumberConverter.ConvertIntegerPartToAnySystem(string.Empty, system)); }