public void GetLinkPostByQuestionAndLinkedPostIds_InvalidArgument(int questionId) { // Arrange SOVAContext databaseContext = new SOVAContext(_connectionString); LinkPostRepository linkPostRepository = new LinkPostRepository(databaseContext); // Act var linkPosts = linkPostRepository.GetLinkedPostByQuestionId(questionId); // Assert Assert.All(linkPosts, Assert.Null); }
public void GetLinkPostByQuestionAndLinkedPostIds_ValidArgument() { // Arrange SOVAContext databaseContext = new SOVAContext(_connectionString); LinkPostRepository linkPostRepository = new LinkPostRepository(databaseContext); int questionId = 841646; int linkedPostId = 19; // Act var linkPosts = linkPostRepository.GetLinkedPostByQuestionId(questionId); // Assert Assert.All(linkPosts, (l) => { Assert.True(l.QuestionId == questionId); Assert.True(l.LinkPostId == linkedPostId); }); }