public void WhenAskForComments_ThenCommentsAreGiven() { // Arrange using (SimpleServer.Create(TestHelpers.BaseUrl, ProductCommentRequesttHandler)) { var client = new YouScribeClient(TestHelpers.BaseUrl); var request = client.CreateProductCommentRequest(); int id = 5; // Act var comments = request.GetCommentsAsync(id, 0, 5, 3).Result; // Assert Assert.NotEmpty(comments.Comments); Assert.Equal(8, comments.Count); Assert.Equal(5, comments.Comments.Count()); var first = comments.Comments.First(); Assert.Equal("test", first.Message); Assert.Equal(0, first.NbReplies); Assert.Equal(7, first.Writer.Id); } }
public void WhenAskForComments_ThenCommentsAreGiven() { // Arrange using (SimpleServer.Create(TestHelpers.BaseUrl, ProductCommentRequesttHandler)) { var client = new YouScribeClient(TestHelpers.BaseUrl); var request = client.CreateProductCommentRequest(); int id = 5; // Act var comments = request.GetCommentsAsync(id, 0, 5, 3).Result; // Assert Assert.NotEmpty(comments.Comments); Assert.Equal(8, comments.Count); Assert.Equal(5, comments.Comments.Count()); var first = comments.Comments.First(); Assert.Equal("test", first.Message); Assert.Equal(0, first.NbReplies); Assert.Equal(7, first.Writer.Id); } }