def testConstructor(self): photon = Photon(4000, Vector(0, 0, 1)) self.assertIsInstance(photon, Photon) self.assertEqual(photon.energy(), 4000) self.assertTrue(photon.unitDirectionVector() == Vector(0, 0, 1))
def testEnergy(self): photon = Photon(4000, Vector(0, 0, 1)) photon.setEnergy(8000.0) self.assertEqual(photon.energy(), 8000)
def testConstructorByDefault(self): photon = Photon() self.assertIsInstance(photon, Photon) self.assertEqual(photon.energy(), 1000.0) self.assertTrue(photon.unitDirectionVector() == Vector(0.0, 1.0, 0.0))