コード例 #1
0
        static void Main(string[] args)
        {
            ISnackRepository snack = new SnackRepository(new MoneyRepository());
            ISnackManager    menu  = new SnackManager(snack);

            menu.Show();
        }
コード例 #2
0
        public void SetUp()
        {
            var connection = DbConnectionFactory.CreatePersistent(Guid.NewGuid().ToString());

            Context     = new FakeDbContext(connection);
            _repository = new SnackRepository(Context);
            _snack      = ObjectMother.snackDefault;

            _snackSeed = ObjectMother.snackDefault;

            Context.Snacks.Add(_snackSeed);
            Context.SaveChanges();
        }
コード例 #3
0
        public void Setup()
        {
            var connection = DbConnectionFactory.CreatePersistent(Guid.NewGuid().ToString());

            _context    = new FakeDbContext(connection);
            _repository = new SnackRepository(_context);
            _snack      = ObjectMother.GetDefaultSnack();

            //Seed
            _snackBase = ObjectMother.GetDefaultSnack();
            _context.Snacks.Add(_snackBase);
            _context.SaveChanges();
        }
コード例 #4
0
 public SnackService(SnackRepository repo)
 {
     _repo = repo;
 }