コード例 #1
0
        public LeasingPresenter(ILeasingView view, VideoprokatContext context)
        {
            _leasingView = view;
            _context     = context;

            _leasingView.OnLeaseMovieCopy += AddLeasing;
        }
コード例 #2
0
        public void SetUp()
        {
            _view = Substitute.For <ILeasingView>();
            var dbContextOptions = new DbContextOptionsBuilder <VideoprokatContext>().UseInMemoryDatabase("TestDb");

            _context = new VideoprokatContext(dbContextOptions.Options);
            _context.Database.EnsureDeleted(); // мне не нужны заполненные данные из OnModelCreating после EnsureCreated
            _presenter = new LeasingPresenter(_view, _context);
        }