示例#1
0
class test_Controller:
    def __init__(self, agendaRepository):
        self.__controller = Controller(agendaRepository)
        self.test_addContact()
        self.test_searchContactByName()
        self.test_searchContactByGroup()
        self.test_exportContacts()

    def test_addContact(self):
        assert self.__controller.addContact(
            "1", "Marian", "13", "Friends") == "Contact added successfully!"
        assert self.__controller.addContact(
            "2", "dada", "12", "Others") == "Contact added successfully!"

    def test_searchContactByName(self):
        assert self.__controller.searchContactByName("izabel") == False
        assert self.__controller.searchContactByName("Marian") != None

    def test_searchContactByGroup(self):
        assert self.__controller.searchContactByGroup("Friends") != None
示例#2
0
文件: tests.py 项目: VladutZzZ/Labs
class test_Controller:
    
    def __init__(self,agendaRepository):
        self.__controller = Controller (agendaRepository)
        self.test_addContact()
        self.test_searchContactByName()
        self.test_searchContactByGroup()
        self.test_exportContacts()
        
    def test_addContact(self):
        assert self.__controller.addContact("1", "Marian", "13", "Friends") == "Contact added successfully!"
        assert self.__controller.addContact("2", "dada", "12", "Others") == "Contact added successfully!"
    
    def test_searchContactByName(self):
        assert self.__controller.searchContactByName("izabel") == False
        assert self.__controller.searchContactByName("Marian") != None
        
    def test_searchContactByGroup(self):
        assert self.__controller.searchContactByGroup("Friends") != None
        

        
        
示例#3
0
'''
Created on 29.01.2013

@author: mihai_000
'''
from Repository.Repository import Repository
from UI.Console import Console
from UI.Controller import Controller

if __name__ == '__main__':
    agendaRepository = Repository ("contacts.txt")
    agendaController = Controller (agendaRepository)
    agendaConsole = Console (agendaController)
    agendaConsole.run()
示例#4
0
from UI.Controller import Controller
from UI.console import UI

from Repository.FlightRepository import FileRepository

repo = FileRepository("flights.txt")
controller = Controller(repo)
ui = UI(controller)

ui.main()
示例#5
0
 def __init__(self, agendaRepository):
     self.__controller = Controller(agendaRepository)
     self.test_addContact()
     self.test_searchContactByName()
     self.test_searchContactByGroup()
     self.test_exportContacts()
示例#6
0
文件: app.py 项目: tudorgergely/Labs
'''
Created on 22.02.2013

@author: mihai_000
'''
from Domain.Validator import Validator
from Repository.Repository import Repository
from UI.Console import Console
from UI.Controller import Controller

if __name__ == '__main__':
    bookRepository = Repository("books.txt")
    bookValidator = Validator()
    bookController = Controller(bookRepository, bookValidator)
    bookConsole = Console(bookController)
    bookConsole.run()
示例#7
0
'''
Created on 23.02.2013

@author: mihai_000
'''
from Domain.Validator import Validator
from Repository.Repository import Repository
from UI.Console import Console
from UI.Controller import Controller, test_Controller

if __name__ == '__main__':
    transRepository = Repository("dictionary.txt")
    testRepository = Repository("test.txt")
    transValidator = Validator()
    transController = Controller(transRepository, transValidator)
    testController = test_Controller(testRepository, transValidator)
    transConsole = Console(transController)
    transConsole.run()
示例#8
0
文件: tests.py 项目: VladutZzZ/Labs
 def __init__(self,agendaRepository):
     self.__controller = Controller (agendaRepository)
     self.test_addContact()
     self.test_searchContactByName()
     self.test_searchContactByGroup()
     self.test_exportContacts()