Exemple #1
0
        public PresenterTests()
        {
            mockCustomerView = Mock.Of<ICustomerView>(view =>
                view.CustomerList == new List<string>());
            mockCustomerRepository = Mock.Of<ICustomerRepository>(repository =>
                repository.GetAllCustomers() == stubCustomerList);

            presenter = new CustomerPresenter(mockCustomerView, mockCustomerRepository);
        }
Exemple #2
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var repository = new Model.CustomerXmlRepository(Application.StartupPath);
            var view       = new View.CustomerForm();

            var presenter = new Presenter.CustomerPresenter(view, repository);

            Application.Run(view);
        }
Exemple #3
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var repository = new Model.CustomerXmlRepository(Application.StartupPath);
            var view = new View.CustomerForm();

            // TODO: IOC
            var presenter = new Presenter.CustomerPresenter(view, repository);

            Application.Run(view);
        }
Exemple #4
0
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var repository = new Model.CustomerXmlRepository(Application.StartupPath);
            var view       = new View.CustomerForm();

            // Poor Man's Dependency Injection/Pure Dependency Injection, Main() is the Composition Root.
            // See https://github.com/mrts/winforms-mvp/issues/2.
            var presenter = new Presenter.CustomerPresenter(view, repository);

            Application.Run(view);
        }