Get all posts
This commit is contained in:
parent
2c7ccae412
commit
d2080679fd
3 changed files with 13 additions and 3 deletions
|
@ -223,5 +223,15 @@ namespace Robware.Api.Blog.Tests {
|
|||
var controller = new BlogController(logger, repo);
|
||||
(await controller.SavePost(submission)).Should().BeOfType<BadRequestObjectResult>();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetAllPosts_ReturnsBlogPostCollection() {
|
||||
var logger = Substitute.For<ILogger<BlogController>>();
|
||||
var repo = Substitute.For<IBlogRepository>();
|
||||
repo.GetAllPostsAsync().Returns(new BlogPost[10]);
|
||||
|
||||
var controller = new BlogController(logger, repo);
|
||||
(await controller.GetAllPosts()).Value.Should().BeEquivalentTo(new BlogPost[10]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue