public async Task GetCommentInformation_ValidResponse_ValidComment()
{
/*** Arrange ***/
string responseString = "{\"type\":\"comment\",\"id\":\"191969\",\"is_reply_comment\":false,\"message\":\"These tigers are cool!\",\"created_by\":{\"type\":\"user\",\"id\":\"17738362\",\"name\":\"sean rose\",\"login\":\"[email protected]\"},\"created_at\":\"2012-12-12T11:25:01-08:00\",\"item\":{\"id\":\"5000948880\",\"type\":\"file\"},\"modified_at\":\"2012-12-12T11:25:01-08:00\"}";
IBoxRequest boxRequest = null;
_handler.Setup(h => h.ExecuteAsync<BoxComment>(It.IsAny<IBoxRequest>()))
.Returns(Task.FromResult<IBoxResponse<BoxComment>>(new BoxResponse<BoxComment>()
{
Status = ResponseStatus.Success,
ContentString = responseString
})).Callback<IBoxRequest>(r => boxRequest = r);
/*** Act ***/
BoxComment c = await _commentsManager.GetInformationAsync("fakeId");
/*** Assert ***/
/*** Request ***/
Assert.AreEqual("fakeId", boxRequest.Path);
/*** Response ***/
Assert.AreEqual("comment", c.Type);
Assert.AreEqual("191969", c.Id);
Assert.AreEqual("These tigers are cool!", c.Message);
}