public void AtoiV1_Number() { string str = "45"; var atoi = new Atoi(); int result = atoi.MyAtoiV1(str); Assert.AreEqual(45, result); }
public void AtoiV1_LetterAfterSign() { string str = " -a 45"; var atoi = new Atoi(); int result = atoi.MyAtoiV1(str); Assert.AreEqual(0, result); }
public void AtoiV1_MoreThanMax() { string str = " 2147483648"; var atoi = new Atoi(); int result = atoi.MyAtoiV1(str); Assert.AreEqual(2147483647, result); }
public void AtoiV1_ZerosFirst() { string str = " 000002147483645"; var atoi = new Atoi(); int result = atoi.MyAtoiV1(str); Assert.AreEqual(2147483645, result); }
public void AtoiV1_SignAfterDigit() { string str = "1-5"; var atoi = new Atoi(); int result = atoi.MyAtoiV1(str); Assert.AreEqual(1, result); }