コード例 #1
0
        public void Execute(DeleteShopModel modal)
        {
            var shop = _shopRepo.Get(modal.ShopId);

            _shopRepo.Remove(shop);
            _uow.Save();
        }
コード例 #2
0
        public DeleteShopTest()
        {
            _shopRepo = new Mock <IShopRepository>();
            _shopRepo.Setup(x => x.Get(It.IsAny <Guid>()))
            .Returns(It.IsAny <Shop>)
            .Verifiable();
            _shopRepo.Setup(x => x.Remove(It.IsAny <Shop>()))
            .Verifiable();

            _uow = new Mock <IUnitOfWork>();
            _uow.Setup(x => x.Save()).Verifiable();

            _service = new DeleteShop(_shopRepo.Object, _uow.Object);

            model = new DeleteShopModel()
            {
                ShopId = Guid.NewGuid()
            };
        }