public UpdateProductCommandHandlerTests() { _mediatoR = new Mock <IMediator>(); var mockedProductRepository = new Mock <IProductRepository>(); _mockUnitOfWork = new Mock <IUnitOfWork>(); _mockUnitOfWork.Setup(x => x.ProductRepository).Returns(mockedProductRepository.Object); _updateProductCommandHandler = new UpdateProductCommandHandler(_mockUnitOfWork.Object, _mediatoR.Object); }
public UpdateProductCommandHandlerTests() { _handler = new UpdateProductCommandHandler(Context, Mapper); _command = new UpdateProductCommand { Id = TestContext.TestProductCommon.Id, Name = "new name", ProductType = ProductType.Vip, Materials = new List <MaterialVm> { new MaterialVm { Name = "wood", Durability = TimeSpan.FromDays(2 * 365) }, new MaterialVm { Name = "iron", Durability = TimeSpan.FromDays(4 * 365) } } }; }