public void DAO_FindByProductIdOrderByDeliveryDateTest() { int numberComments = 3; List <Comment> createdComments = new List <Comment>(numberComments); for (int i = 0; i < numberComments; i++) { var comment = new Comment(); comment.comment1 = commentBody; comment.commentDate = date; comment.productId = product.productId; comment.userId = user.usrId; commentDao.Create(comment); createdComments.Add(comment); } List <Comment> totalRetrievedComments = commentDao.FindByProductIdOrderByDeliveryDate(product.productId); Assert.AreEqual(numberComments, totalRetrievedComments.Count); for (int i = 0; i < numberComments; i++) { Assert.AreEqual(totalRetrievedComments[i], createdComments[i]); } }