示例#1
0
 def test_one_digit_number(self):
     string_to_convert = "9"
     converter = StringToIntConverter(string_to_convert)
     converted_int = converter.convert()
     self.assertEquals(converted_int, 9)
示例#2
0
 def test_None_converted_to_0(self):
     string_to_convert = None
     converter = StringToIntConverter(string_to_convert)
     converted_int = converter.convert()
     self.assertEquals(converted_int, 0)
示例#3
0
 def test_empty_string_converted_to_0(self):
     string_to_convert = ""
     converter = StringToIntConverter(string_to_convert)
     converted_int = converter.convert()
     self.assertEquals(converted_int, 0)
示例#4
0
 def test_number_that_ends_with_0(self):
     string_to_convert = "110"
     converter = StringToIntConverter(string_to_convert)
     converted_int = converter.convert()
     self.assertEquals(converted_int, 110)
示例#5
0
 def test_number_with_0_in_middle(self):
     string_to_convert = "101"
     converter = StringToIntConverter(string_to_convert)
     converted_int = converter.convert()
     self.assertEquals(converted_int, 101)
示例#6
0
 def test_10_digit_number(self):
     string_to_convert = "1234567891"
     converter = StringToIntConverter(string_to_convert)
     converted_int = converter.convert()
     self.assertEquals(converted_int, 1234567891)