コード例 #1
0
 def test100_950_ShouldNotConstructOnNonNumericMinute(self):
     expectedString = "Latitude.__init__:"
     with self.assertRaises(ValueError) as context:
         LT.Latitude(degrees=60.5, minutes='20.5')
     self.assertEquals(expectedString,
                       context.exception.args[0][0:len(expectedString)],
                       "Major:  failure to check Parameter Type")
コード例 #2
0
 def test100_960_ShouldNotConstructOnOutOfBoundMinuteValue(self):
     expectedString = "Latitude.__init__:"
     with self.assertRaises(ValueError) as context:
         LT.Latitude(degrees=60, minutes=61)
     self.assertEquals(expectedString,
                       context.exception.args[0][0:len(expectedString)],
                       "Major:  failure to check Bound of Parameter")
コード例 #3
0
 def test100_940_ShouldNotConstructOnMissingMinute(self):
     expectedString = "Latitude.__init__:"
     with self.assertRaises(ValueError) as context:
         LT.Latitude(degrees=60, hemisphere='S')
     self.assertEquals(
         expectedString, context.exception.args[0][0:len(expectedString)],
         "Major:  failure to check Missing Mandatory Parameter")
コード例 #4
0
 def test400_010_ShouldReturnDefaultHemisphere(self):
     degrees = 60
     minutes = 20.5
     latitude = LT.Latitude(degrees, minutes)
     self.assertEquals(1, latitude.getHemisphere())
コード例 #5
0
 def test300_010_ShouldReturnMinute(self):
     degrees = 60
     minutes = 20.5
     latitude = LT.Latitude(degrees, minutes)
     self.assertEquals(minutes, latitude.getMinutes())
コード例 #6
0
 def test100_020_ShouldConstructWithOutOptionalParam(self):
     degrees = 60
     minutes = 20.5
     self.assertIsInstance(LT.Latitude(degrees, minutes), LT.Latitude)
コード例 #7
0
 def test100_010_ShouldConstruct(self):
     degrees = 60
     minutes = 20.5
     hemisphere = 'S'
     self.assertIsInstance(LT.Latitude(degrees, minutes, hemisphere),
                           LT.Latitude)
コード例 #8
0
 def test500_020_ShouldReturnString(self):
     degrees = 0
     minutes = 0
     latitude = LT.Latitude(degrees, minutes)
     self.assertEquals('0 0.0', latitude.getString())
コード例 #9
0
 def test500_010_ShouldReturnStringForLatitude(self):
     degrees = 60
     minutes = 20.5
     hemisphere = 'N'
     latitude = LT.Latitude(degrees, minutes, hemisphere)
     self.assertEquals('N60 20.5', latitude.getString())
コード例 #10
0
 def test400_030_ShouldReturnEmptyHemisphere(self):
     degrees = 0
     minutes = 0
     latitude = LT.Latitude(degrees, minutes)
     self.assertEquals(0, latitude.getHemisphere())
コード例 #11
0
 def test400_020_ShouldReturnPassedHemisphere(self):
     degrees = 60
     minutes = 20.5
     hemisphere = 'S'
     latitude = LT.Latitude(degrees, minutes, hemisphere)
     self.assertEquals(-1, latitude.getHemisphere())