public void Should_Skip_Last_Invalid_Chars() { var result = ParseInt.Parse("123ABC"); var expected = 123; Assert.AreEqual(expected, result); }
public void Should_Parse_String() { var result = ParseInt.Parse("123"); var expected = 123; Assert.AreEqual(expected, result); }
public void Should_Parse_String_As_Negative() { var result = ParseInt.Parse("-123"); var expected = -123; Assert.AreEqual(expected, result); }
static void Main(string[] args) { DelTest1 test = new DelTest1(); ParseInt p = new ParseInt(test.convertInt); Console.WriteLine(p("123")); ParseInt p2 = test.convertInt; }
public void Should_Throw_On_Invalid_Input() { var invalidArgument = "ABC123"; Assert.Throws <ArgumentException>(() => ParseInt.Parse(invalidArgument)); }