Example #1
0
	def testValidFire(self):
		testUnit = Unit.purchaseUnit(1,0,self.testPlayer)
		testTower = self.testPlayer.purchaseTower((1,0))
		self.testTower.fire(testUnit)
		self.assertEquals(testUnit.health, 0)
Example #2
0
	def testValidPurchaseUnit(self):
		testUnit = Unit.purchaseUnit(1,1,self.testPlayer)
		self.assertEquals(testUnit.level,1)
		self.assertEquals(testUnit.specialisation,1)
		self.assertEquals(testUnit.owner, self.testPlayer.name)
Example #3
0
	def testInvalidPurchaseUnit2(self):
		testUnit = Unit.purchaseUnit(1,-2,self.testPlayer)
		self.assertEquals(testUnit, None)
		testUnit = Unit.purchaseUnit(1,2,self.testPlayer)
		self.assertEquals(testUnit, None)
Example #4
0
	def testInvalidPurchaseUnit1(self):
		test = Unit.purchaseUnit(3,0,self.testPlayer)
		self.assertEquals(test,None)
Example #5
0
	def testInvalidPurchaseUnit(self):
		self.testPlayer.resources = 0
		test = Unit.purchaseUnit(1,0,self.testPlayer)
		self.assertEquals(test,None)
Example #6
0
	def testValidMovement(self):
		testUnit=Unit.purchaseUnit(1,0,self.testPlayer)
		paths=self.testBoard.findPaths()
		self.assertTrue(self.testBoard.queueUnit(testUnit, 3))
		self.testBoard.moveUnits()
		self.assertEquals(self.testBoard.paths[3].moving.pop(), testUnit)