def test_now(self): ''' Testing Now Method''' a = ParticleSim() t = a.now() self.assertEqual(0.0,t)
def test_Insert_Exception(self): ''' Testing insertion method for Exception''' try: a = ParticleSim() a.insert(4) self.assertTrue(False,'no exception or/ no right type of excepttion raised') except TypeError: pass
def test_DoallEvents_one_initial_envent(self): '''Testing DoallEventsMethod''' a = ParticleSim() a.setup() print('********************************************************') print('##TEST for n = 1 mean = 4 seed =None') print('Pay attention here to check whether the simulation driver is doing the rihgt thing') a.doAllEvents()
def test_DoAllEvents_30(self): '''Testing DoallEventsMethod''' a = ParticleSim() a.setup(30,10,3) print('********************************************************') print(' ##TEST For n=30 mean = 10 seed = 3 ') print('Pay attention here to check whether the simulation driver is doing the rihgt thing') a.doAllEvents()
def test_Insert(self): ''' Testing insertion method''' a = ParticleEvent(4) a1 = ParticleEvent(1) a2 = ParticleEvent(0) b = ParticleSim() b.insert(a) b.insert(a1) b.insert(a2) self.assertEqual(str(b.event),'[<Event: 0.0>*, <Event: 1.0>, <Event: 4.0>]')
def testEmpty_constructor(self): ''' Testing Constructor Method''' a = ParticleSim() time = a.now() self.assertEqual(0.0,time)