예제 #1
0
        public void Should_Skip_Last_Invalid_Chars()
        {
            var result   = ParseInt.Parse("123ABC");
            var expected = 123;

            Assert.AreEqual(expected, result);
        }
예제 #2
0
        public void Should_Parse_String_As_Negative()
        {
            var result   = ParseInt.Parse("-123");
            var expected = -123;

            Assert.AreEqual(expected, result);
        }
예제 #3
0
        public void Should_Parse_String()
        {
            var result   = ParseInt.Parse("123");
            var expected = 123;

            Assert.AreEqual(expected, result);
        }
예제 #4
0
        public void Should_Throw_On_Invalid_Input()
        {
            var invalidArgument = "ABC123";

            Assert.Throws <ArgumentException>(() => ParseInt.Parse(invalidArgument));
        }