public ICollection <IEvent> Handle(CreateTheme command) { var theme = Theme.CreateNew(command, _validator, _sortOrderGenerator); _themeRepository.Create(theme); return(theme.Events); }
public IAggregateRoot Handle(CreateTheme command) { var theme = Theme.CreateNew(command, _validator, _sortOrderGenerator); _themeRepository.Create(theme); return(theme); }
public void Should_save_new_theme() { var newTheme = ThemeFactory.Theme(Guid.NewGuid(), "Name 3", "Description 3", "Folder 3"); _sut.Create(newTheme); var actual = _sut.GetById(newTheme.Id); Assert.NotNull(actual); }
public void Should_save_new_theme() { var newTheme = ThemeFactory.Theme(Guid.NewGuid(), "Name 3", "Description 3", "Folder 3"); var newThemeDbEntity = new ThemeDbEntity { Id = newTheme.Id, Name = newTheme.Name, Description = newTheme.Description, Folder = newTheme.Folder }; var mapperMock = new Mock <IMapper>(); mapperMock.Setup(x => x.Map <ThemeDbEntity>(newTheme)).Returns(newThemeDbEntity); mapperMock.Setup(x => x.Map <Theme>(newThemeDbEntity)).Returns(newTheme); _sut = new ThemeRepository(_dbContext, mapperMock.Object); _sut.Create(newTheme); var actual = _sut.GetById(newTheme.Id); Assert.NotNull(actual); }
public async Task CreateTheme(VSCodeTheme newTheme) { await _themeRepository.Create(newTheme); Log.Information($"Created new theme in store: Id='{newTheme.Id}'."); }
public void CreateTheme(ThemeEntity theme) { themeRepository.Create(theme.ToDalTheme()); uow.Commit(); }
public async Task Create(Theme theme) => await themeRepository.Create(theme);
/// <summary> /// Creates a topic /// </summary> /// <param name="entity"> Theme</param> public void Create(BllTheme entity) { themeRepository.Create(entity.ToDalTheme()); unitOfWork.Commit(); }