public void SetUp() { _categoryService = new Mock <ICategoryService>(); _eventPublisher = new Mock <IEventPublisher>(); _handler = new CreateCategoryHandler(_categoryService.Object, _eventPublisher.Object); }
public async Task CreateCategory_Success_ReturnUnit() { // Arrange var createCategoryCommand = new CreateCategoryCommand() { Name = "Phone", Thumbnail = "no-image.jpg" }; // Act var sut = new CreateCategoryHandler(_fuhoDbContext, _mapper.Object); var result = await sut.Handle(createCategoryCommand, CancellationToken.None); // Result Assert.IsType <CreateCategoryResponse>(result); }
public CreateCategoryHandlerTests() { _helper = new Helper(); _handler = new CreateCategoryHandler(_helper.MockUnitOfWorkFactory.Object, _helper.MockEventDispatcher.Object); }
public CreateCategoryTests() { _context = ProductCatalogContextFactory.Create(); _handler = new CreateCategoryHandler(_context); }