public void SetUp()
        {
            _view = Substitute.For <IMainView>();
            var dbContextOptions = new DbContextOptionsBuilder <VideoprokatContext>().UseInMemoryDatabase("TestDb");

            _context = new VideoprokatContext(dbContextOptions.Options);
            _context.Database.EnsureDeleted(); // мне не нужны заполненные данные из OnModelCreating после EnsureCreated
            _moviePresenter        = Substitute.For <IMoviePresenter>();
            _movieCopyPresenter    = Substitute.For <IMovieCopyPresenter>();
            _leasingPresenter      = Substitute.For <ILeasingPresenter>();
            _customersPresenter    = Substitute.For <ICustomersPresenter>();
            _importMoviesPresenter = Substitute.For <IImportMoviesPresenter>();
            _returnPresenter       = Substitute.For <IReturnPresenter>();

            _presenter = new MainPresenter(
                _view,
                _context,
                _moviePresenter,
                _movieCopyPresenter,
                _leasingPresenter,
                _customersPresenter,
                _importMoviesPresenter,
                _returnPresenter
                );
        }
        public void SetUp()
        {
            _view = Substitute.For <IMovieView>();
            var dbContextOptions = new DbContextOptionsBuilder <VideoprokatContext>().UseInMemoryDatabase("TestDb");

            _context = new VideoprokatContext(dbContextOptions.Options);
            _context.Database.EnsureDeleted(); // мне не нужны заполненные данные из OnModelCreating после EnsureCreated
            _presenter = new MoviePresenter(_view, _context);
        }
        public MainPresenter(
            IMainView mainView,
            VideoprokatContext context,
            IMoviePresenter moviePresenter,
            IMovieCopyPresenter movieCopyPresenter,
            ILeasingPresenter leasingPresenter,
            ICustomersPresenter customersPresenter,
            IImportMoviesPresenter importMoviesPresenter,
            IReturnPresenter returnPresenter
            )
        {
            _context               = context;
            _mainView              = mainView;
            _moviePresenter        = moviePresenter;
            _movieCopyPresenter    = movieCopyPresenter;
            _leasingPresenter      = leasingPresenter;
            _customersPresenter    = customersPresenter;
            _importMoviesPresenter = importMoviesPresenter;
            _returnPresenter       = returnPresenter;

            _mainView.OnLoad += LoadMain;

            _mainView.OnOpenCustomers    += OpenCustomers;
            _mainView.OnOpenMovie        += OpenMovie;
            _mainView.OnOpenMovieCopy    += OpenMovieCopy;
            _mainView.OnOpenLeasing      += OpenLeasing;
            _mainView.OnOpenImportMovies += OpenImportMovies;
            _mainView.OnOpenReturn       += OpenReturn;

            _mainView.OnUpdateMovie     += UpdateMovie;
            _mainView.OnUpdateMovieCopy += UpdateMovieCopy;

            _mainView.OnFilterMovies += FilterMovies;

            _mainView.OnMovieSelectionChanged     += MovieSelectionChanged;
            _mainView.OnMovieCopySelectionChanged += MovieCopySelectionChanged;
        }