public static void TestJsonResultCreationSuccess() { Product product = new Product() { ProductName = "Vfresh 100% Fruit Juice - Grape (1L)", Price = 125000, CategoryId = 63, AvailableQty = 560, }; var jsonRes = controller.AddOrEdit(product) as JsonResult; dynamic data = jsonRes.Data; //bool testValue = GetValueFromJsonResult<bool>(jsonRes, "success"); bool success = (bool)(new PrivateObject(jsonRes.Data, "success")).Target; Assert.IsTrue(success); }