public void Update()
        {
            imagesMapper.UpdateCollection(service.GetImages(), Images);

            RefreshCommand.UpdateState();
            DeleteImagesCommand.UpdateState();
        }
Ejemplo n.º 2
0
        public async Task RemoveImagesCommand_RemovesEntries()
        {
            var context = CreateDbContextStub();
            var command = new DeleteImagesCommand(context);

            await command.ExecuteAsync(3);

            var entries = context.Entries.ToArray();

            Assert.Equal(3, entries.Length);
            Assert.Equal(1, entries[0].Number);
            Assert.Equal(2, entries[1].Number);
            Assert.Equal(3, entries[2].Number);
        }
Ejemplo n.º 3
0
        private DeleteImagesCommand CreateStubDeleteImagesCommand(out Article article)
        {
            article = new Article()
            {
                ArticleText = File.ReadAllText("articletext.txt"),
                Images = new List<string>()
            };
            article.Images.Add("10960593_files/1.jpg");
            article.Images.Add("10960593_files/2.jpg");

            var articles = new List<Article>();
            articles.Add(article);

            var deleteImagesCommand = new DeleteImagesCommand(articles);

            return deleteImagesCommand;
        }
Ejemplo n.º 4
0
 public void DeleteImages(IList<Article> articles)
 {
     var deleteImagesCommand = new DeleteImagesCommand(articles);
     _commandExecutor.ExecuteCommand(deleteImagesCommand);
 }