Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)