コード例 #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)