Ejemplo n.º 1
0
        public void UpdatePost()
        {
            AutoMapperDataConfig.RegisterMappings();
            PublisherService publisherService = new PublisherService(new PostRepository(), new TagRepository());

            var postDto = new PostDto()
            {
                Id = 1,
                Body = "Body 1",
                Title = "Title 1",
                User = new UserDto()
                {
                    Login = "******"
                }
            };

            publisherService.Edit(postDto);

            var postUpdated = publisherService.GetById(1);

            Assert.IsNotNull(postUpdated);

            Assert.AreEqual(postDto.Body, postUpdated.Body);

            Assert.AreEqual(postDto.Title, postUpdated.Title);
        }