public void TestGetPostCount() { var postDataAccess = new PostDataAccess(new MockPostRepo(), new MockPostValidator(), new MockAuthorRepo(), new MockAuthorValidator()); var post = new Post("", new Author("", 0), ""); var listOfPosts = new List <Post>() { post }; new MockPostRepo().StubGetAllPosts(listOfPosts); var returnedCount = postDataAccess.GetPostCount(); new MockPostRepo().AssertGetAllPostsCalled(); Assert.Equal(listOfPosts.Count, returnedCount); }