예제 #1
0
        public void SetUp()
        {
            forTest = new ObjectMother();

            repository = forTest.PopulatedXmlRepository();

            presenter = forTest.IBorrowBookPresenterMethodInvocationMock(1);

            UseCaseFactory create = new UseCaseFactory();

            useCase = create.BoorowBook(repository);
            useCase.AttachPresenter(presenter);
        }
예제 #2
0
        public override void DidFinishLaunching(NSNotification notification)
        {
            // Insert code here to initialize your application

            BorrowBookCocaPresenter presenter = new BorrowBookCocaPresenter();

            IBorrowBookView view = NSApplication.SharedApplication.MainWindow as IBorrowBookView;

            view.AttachPresenter(presenter);

            UseCaseFactory     create  = new UseCaseFactory();
            IBorrowBookUseCase useCase = create.BoorowBook(new InMemoryRepository());

            useCase.AttachPresenter(presenter);
        }
예제 #3
0
        public static void Main(string[] args)
        {
            Console.Write("Type reader's card id: ");
            string cardId = Console.ReadLine();

            Console.Write("Type book's isbn: ");
            string isbn = Console.ReadLine();

            Console.WriteLine();


            IBorrowBookPresenter presenter = new CliBorrowBookPresenter();


            UseCaseFactory create = new UseCaseFactory();

            ObjectMother       fakes   = new ObjectMother();
            IBorrowBookUseCase useCase = create.BoorowBook(fakes.PopulatedInMemoryRepository());

            useCase.AttachPresenter(presenter);


            presenter.BorrowBook(cardId, isbn);
        }