示例#1
0
        public async void Task_Add_Return_OkRequest()
        {
            var controller = new FeedBackController(context);
            var user       = new FeedBack()
            {
                Message    = "Awesome",
                CustomerId = 1
            };
            var data = await controller.Post(user);

            Assert.IsType <CreatedAtActionResult>(data);
        }
示例#2
0
        public void PostTest()
        {
            var target = new FeedBackController();

            var targetResponse = target.Post(postTestValue);

            Assert.IsInstanceOfType(targetResponse, typeof(OkNegotiatedContentResult <BaseResponse <FeedBack> >));
            var targetResponseData = targetResponse as OkNegotiatedContentResult <BaseResponse <FeedBack> >;

            Assert.IsNotNull(targetResponseData);
            Assert.IsNotNull(targetResponseData.Content);
            Assert.IsTrue(targetResponseData.Content.Success);
        }