Beispiel #1
0
 public void ConvertToIntWithNullValueShouldThrowException()
 {
     Assert.ThrowsException <ArgumentNullException>(() =>
     {
         var result = InstructionHelper.ConvertToInt(null);
     });
 }
Beispiel #2
0
        public void ConvertToIntWithZeroValueShouldReturnInteger()
        {
            var value = "0";

            var result = InstructionHelper.ConvertToInt(value);

            Assert.AreEqual(int.Parse(value), result);
        }
Beispiel #3
0
        public void ConvertToIntWithInvalidValueShouldThrowException()
        {
            var value = "foo";

            Assert.ThrowsException <FormatException>(() =>
            {
                var result = InstructionHelper.ConvertToInt(value);
            });
        }
Beispiel #4
0
        public void ConvertToIntWithEmptyValueShouldThrowException()
        {
            var value = string.Empty;

            Assert.ThrowsException <ArgumentException>(() =>
            {
                var result = InstructionHelper.ConvertToInt(value);
            });
        }