Beispiel #1
0
    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))
Beispiel #2
0
 def testEnergy(self):
     photon = Photon(4000, Vector(0, 0, 1))
     photon.setEnergy(8000.0)
     self.assertEqual(photon.energy(), 8000)
Beispiel #3
0
    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))