Esempio n. 1
0
class normalize(unittest.TestCase):
    """ Tests that Normalize normalizes correctly """
    def setUp(self):
        """ Build the Recoil Delegate """
        self.delegate = RecoilDelegate(2)

    def zero(self):
        """ Test that < 1 is normalized correctly """
        damage = 0
        newDamage = self.delegate.normalize(damage)
        assert newDamage == 1, "Should return one if between 0 and 1"

    def normalize(self):
        """ Test that normalizing an int returns the int """
        damage = 3
        newDamage = self.delegate.normalize(damage)
        assert newDamage == damage, "Should return the number if its an int"
Esempio n. 2
0
class normalize(unittest.TestCase):
    """ Tests that Normalize normalizes correctly """
    
    def setUp(self):
        """ Build the Recoil Delegate """
        self.delegate = RecoilDelegate(2)
        
    def zero(self):
        """ Test that < 1 is normalized correctly """
        damage = 0
        newDamage = self.delegate.normalize(damage)
        assert newDamage == 1, "Should return one if between 0 and 1"
        
    def normalize(self):
        """ Test that normalizing an int returns the int """
        damage = 3
        newDamage = self.delegate.normalize(damage)
        assert newDamage == damage, "Should return the number if its an int"