public void DeletePost() { AutoMapperDataConfig.RegisterMappings(); PublisherService publisherService = new PublisherService(new PostRepository(), new TagRepository()); int maxId = publisherService.GetAllPosts().Max(x => x.Id); var postDto = new PostDto() { Id = maxId }; publisherService.Delete(postDto); var postDeleted = publisherService.GetById(maxId); Assert.IsNull(postDeleted); }