def test900_081_RaisesErrorForInsufficientRepository(self): data = HistoricalData() comp1 = Component("foo1",0,86) comp2 = Component("foo2",0,65) data.addComponent(comp1) data.addComponent(comp2) crcCard = Crc(name="foo",methods=["__init__","foo1","foo2"],design="OO",componentType="I/O") crcCard.setSize("M") self.assertRaises(ValueError,data.estimateSize,crcCard)
def test42_Return112(self): c1 = Component("c1",1,100,"OO") c2 = Component("c2",2,100,"OO") c3 = Component("c3",3,100,"OO") repository = HistoricalData() repository.addComponent(c1) repository.addComponent(c2) repository.addComponent(c3) crc = Crc("crc",["__init__","getName"]) crc.setSize("M") repository.estimateSize(crc) self.assertEqual(crc.getLoc(),112)
def test100_040_CalculateSizeOfCRCCard(self): data = HistoricalData() comp1 = Component("foo1",4,86) comp2 = Component("foo2",6,65) comp3 = Component("foo3",5,126) comp4 = Component("foo4",6,68) comp5 = Component("foo5",4,121) data.addComponent(comp1) data.addComponent(comp2) data.addComponent(comp3) data.addComponent(comp4) data.addComponent(comp5) crcCard = Crc(name="foo",methods=["__init__","foo1","foo2"],design="OO",componentType="I/O") crcCard.setSize("VS") data.estimateSize(crcCard) self.assertEqual(crcCard.getLoc(), 24)
def test100_050_SetValidSize(self): card = Crc(name="foo",methods=["foo"],collaborators=["bar"],design="FD", componentType="Calculation") card.setSize("VS") self.assertEqual(card.getSize(), "VS")
def test100_043_CreateFDInstanceOfUsingDefaults(self): crcCard = Crc(name="foo",design="FD") self.assertEqual(crcCard.getParent(), None)
def test100_040_SetValidLoc(self): card = Crc(name="foo",methods=["foo"],collaborators=["bar"],design="FD", componentType="Calculation") card.setLoc(42) self.assertEqual(card.getLoc(), 42)
def test100_041_CreateFDInstanceOfUsingDefaults(self): crcCard = Crc(name="foo",design="FD") self.assertEqual(crcCard.getCollaborators(), [])
def test100_040_CreateFDInstanceOfUsingDefaults(self): crcCard = Crc(name="foo",design="FD") self.assertEqual(crcCard.getMethods(),["foo"])
def test100_024_CreateInstanceOfOOUsingDefaults(self): crcCard = Crc(name="foo",methods=["__init__","add","sub"]) self.assertEqual(crcCard.getParent(), None)
def test100_023_CreateInstanceOfOOUsingDefaults(self): crcCard = Crc(name="foo",methods=["__init__","add","sub"]) self.assertEqual(crcCard.getCollaborators(), [])
def test100_021_CreateInstanceOfOOUsingDefaults(self): crcCard = Crc(name="foo",methods=["__init__","add","sub"]) self.assertEqual(crcCard.getDesign(), "OO")