Box.V2.Test.BoxCommentsManagerTest.AddComment_ValidResponse_ValidComment C# (CSharp) Метод

AddComment_ValidResponse_ValidComment() приватный Метод

private AddComment_ValidResponse_ValidComment ( ) : System.Threading.Tasks.Task
Результат System.Threading.Tasks.Task
        public async Task AddComment_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 ***/
            BoxCommentRequest request = new BoxCommentRequest()
            {
                Item = new BoxRequestEntity()
                {
                    Id = "fakeId",
                    Type = BoxType.file
                },
                Message = "fake message"
            };
            BoxComment c = await _commentsManager.AddCommentAsync(request);

            /*** Assert ***/
            /*** Request ***/
            BoxCommentRequest payLoad = JsonConvert.DeserializeObject<BoxCommentRequest>(boxRequest.Payload);
            Assert.AreEqual(request.Message, payLoad.Message);
            Assert.AreEqual(request.Item.Id, payLoad.Item.Id);
            Assert.AreEqual(request.Item.Type, payLoad.Item.Type);
            /*** Response***/
            Assert.AreEqual("comment", c.Type);
            Assert.AreEqual("191969", c.Id);
            Assert.AreEqual("These tigers are cool!", c.Message);
        }