public void SetUp() { _repository = Substitute.For <IItemRepository>(); _repository.GetAsync(FakeItem.Id).Returns(FakeItem); _itemCacher = new ItemCacher(_repository); }
public ItemsController( IItemRepository repository, IUrlGenerator urlGenerator, IItemCreator itemCreator, IItemCacher itemCacher, IItemUpdater itemUpdater) { _repository = repository; _urlGenerator = urlGenerator; _itemCreator = itemCreator; _itemCacher = itemCacher; _itemUpdater = itemUpdater; }
public void SetUp() { _repository = Substitute.For <IItemRepository>(); var urlGenerator = Substitute.For <IUrlGenerator>(); urlGenerator.GetItemUrl(FakeItem.Id).Returns($"api/v1/itemlist/{FakeItem.Id}"); _itemCreator = Substitute.For <IItemCreator>(); _itemCacher = Substitute.For <IItemCacher>(); _itemUpdater = Substitute.For <IItemUpdater>(); _controller = new ItemsController(_repository, urlGenerator, _itemCreator, _itemCacher, _itemUpdater) { Request = new HttpRequestMessage(), Configuration = new HttpConfiguration() }; }