def testUnassignCompoent( self ):
     resolver = MilestoneRelationshipResolver( 'test-milestone', self._db )
     resolver.assignToComponentID( 'test-component' )
     components = resolver.getAllAssignedComponentIDs()
     self.assertEquals([ 'test-component' ], components )
     
     resolver.unassignFromComponentID( 'test-component' )
     components = resolver.getAllAssignedComponentIDs()
     self.assertEquals( [], components )
     self.assertDatabaseContainsNoRow()
    def testAssignComponent( self ):
        resolver1 = MilestoneRelationshipResolver( 'test-milestone', self._db ) 
        resolver2 = MilestoneRelationshipResolver( 'test-milestone-2', self._db ) 
        resolver1.assignToComponentID( 'test-component-name' )
        resolver2.assignToComponentID( 'another-component-name' )

        components1 = resolver1.getAllAssignedComponentIDs()
        components2 = resolver2.getAllAssignedComponentIDs()
        self.assertEquals([ 'test-component-name' ], components1 )
        self.assertEquals([ 'another-component-name' ], components2 )
 def getByName( self, name ):
     resolver = MilestoneRelationshipResolver( name, self._db )
     componentIDs = resolver.getAllAssignedComponentIDs()
     components = self._componentFactory.getAllByNames( componentIDs )
     projectIDs = resolver.getAllAssignedProjectIDs()
     projects = self._projectFactory.getAllByNames( projectIDs )
     
     return Milestone( name, components, projects )
 def testGetAllAssignedComponentes( self ):
     resolver = MilestoneRelationshipResolver( 'test-milestone', self._db )
     self.assertEquals( [], resolver.getAllAssignedComponentIDs() )