Beispiel #1
0
        public ICollection <IEvent> Handle(CreateTheme command)
        {
            var theme = Theme.CreateNew(command, _validator, _sortOrderGenerator);

            _themeRepository.Create(theme);

            return(theme.Events);
        }
Beispiel #2
0
        public IAggregateRoot Handle(CreateTheme command)
        {
            var theme = Theme.CreateNew(command, _validator, _sortOrderGenerator);

            _themeRepository.Create(theme);

            return(theme);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        public async Task CreateTheme(VSCodeTheme newTheme)
        {
            await _themeRepository.Create(newTheme);

            Log.Information($"Created new theme in store: Id='{newTheme.Id}'.");
        }
Beispiel #6
0
 public void CreateTheme(ThemeEntity theme)
 {
     themeRepository.Create(theme.ToDalTheme());
     uow.Commit();
 }
Beispiel #7
0
 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();
 }