コード例 #1
0
        protected override void Before_each()
        {
            _aiList = new List<AssaultItem>
                          {
                              new AssaultItem {Description = "Stormtrooper"},
                              new AssaultItem {Description = "AT-ST"}
                          };

            _repo = Stub<IRepository<AssaultItem>>();
            _repo.Stub(x => x.GetAll()).Return(_aiList);

            _service = new InventoryService(_repo);
        }
コード例 #2
0
        protected override void Before_each()
        {
            _repo = Stub<IRepository<AssaultItem>>();
            _repo.Stub(x => x.GetById(2)).Return(new AssaultItem {Description = "AI2"});

            _service = new InventoryService(_repo);
        }
コード例 #3
0
        protected override void Before_each()
        {
            _item = new AssaultItem {Description = "Description", Type = "Type", LoadValue = 2};

            _repo = Stub<IRepository<AssaultItem>>();
            _repo.Stub(x => x.Save(_item)).Return(9);
            _repo.Stub(x => x.GetById(9)).Return(_item);

            _service = new InventoryService(_repo);
        }