public void ConvertToIntWhenValidNegativeSymbolShouldReturnEquivalentNumber() { Exercises testExercise = new Exercises(); Assert.Equal(-1, testExercise.ConvertToInt("-1")); }
public void ConvertToIntWhenInvalidCharsShouldThrowException() { Exercises testExercise = new Exercises(); Assert.Throws <FormatException>(() => testExercise.ConvertToInt("one")); }
public void ConvertToIntWhenValidCharsShouldReturnEquivalentNumber() { Exercises testExercise = new Exercises(); Assert.Equal(1, testExercise.ConvertToInt("1")); }
public void ConvertToIntWhenEmptyStringShouldThrowException() { Exercises testExercise = new Exercises(); Assert.Throws <FormatException>(() => testExercise.ConvertToInt("")); }
public void ConvertToIntWhenNullShouldThrowException() { Exercises testExercise = new Exercises(); Assert.Throws <ArgumentNullException>(() => testExercise.ConvertToInt(null)); }
public void ConvertToIntWhenLowerThanIntShouldThrowException() { Exercises testExercise = new Exercises(); Assert.Throws <OverflowException>(() => testExercise.ConvertToInt("-2147483649")); }
public void ConvertToIntWhenInvalidNegativeSymbolShouldThrowException() { Exercises testExercise = new Exercises(); Assert.Throws <FormatException>(() => testExercise.ConvertToInt("1-")); }