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

            var result = InstructionHelper.ConvertToInt(value);

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

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

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