public void Initialize() { // Item navigation properties _header = new Header() { Title = string.Empty.PadRight(50, 'H'), UserId = 1 }; _entry = new Entry() { Message = string.Empty.PadRight(2000, 'M') }; // Mock _mockItemRepository = new Mock <IRepository <Item> >(); _mockUow = new Mock <IUnitOfWork>(); _mockUow .Setup(uow => uow.GetRepository <Item>()) .Returns(_mockItemRepository.Object); _mockUow .Setup(u => u.Commit()) .Returns(3); _mockItemRepository .Setup(r => r.Insert(It.IsAny <Item>())) .Returns(_item); // Sut _sut = new ItemDomainService(_mockItemRepository.Object); }
public void Initialize() { // Item navigation properties _header = new Header() { Title = string.Empty.PadRight(50, 'H'), UserId = 1 }; _entry = new Entry() { Message = string.Empty.PadRight(2000, 'M') }; // Mock _mockItemRepository = new Mock<IRepository<Item>>(); _mockUow = new Mock<IUnitOfWork>(); _mockUow .Setup(uow => uow.GetRepository<Item>()) .Returns(_mockItemRepository.Object); _mockUow .Setup(u => u.Commit()) .Returns(3); _mockItemRepository .Setup(r => r.Insert(It.IsAny<Item>())) .Returns(_item); // Sut _sut = new ItemDomainService(_mockItemRepository.Object); }
public ItemHandler(IItemRepository itemRepository, ItemDomainService itemDomainService) { _itemRepository = itemRepository; _itemDomainService = itemDomainService; }