public void ConvertToIntWithNullValueShouldThrowException() { Assert.ThrowsException <ArgumentNullException>(() => { var result = InstructionHelper.ConvertToInt(null); }); }
public void ConvertToIntWithZeroValueShouldReturnInteger() { var value = "0"; var result = InstructionHelper.ConvertToInt(value); Assert.AreEqual(int.Parse(value), result); }
public void ConvertToIntWithInvalidValueShouldThrowException() { var value = "foo"; Assert.ThrowsException <FormatException>(() => { var result = InstructionHelper.ConvertToInt(value); }); }
public void ConvertToIntWithEmptyValueShouldThrowException() { var value = string.Empty; Assert.ThrowsException <ArgumentException>(() => { var result = InstructionHelper.ConvertToInt(value); }); }