//using Knoks.Api.Client.Invoker;
//using Newtonsoft.Json.Linq;
//using System.Net;
//using System.Threading.Tasks;
//using Xunit;

//namespace Knoks.Test.Integrations.Api
//{
//    public class PingControllerTest : ApiTest
//    {
//        [Theory(DisplayName = "Ping")]
//        [InlineData(null)]
//        [InlineData("text")]
//        async Task Ping(string info)
//        {
//            var res = (await Request<JObject>("Ping" + (info == null ? string.Empty : $"?info={info}"))).Object;
//            Assert.Equal(info, res["value"].Value<string>());
//        }

//        [Fact(DisplayName = "Ping Optional User with consumer token")]
//        async Task PingConsumer()
//        {
//            await AuthorizeApiConsumer();

//            var res = (await Request<JObject>("Ping/OptionalUser")).Object;
//            Assert.Equal(JTokenType.Null, res["value"].Value<JValue>().Type);
//        }

//        [Theory(DisplayName = "Ping Optional User with user token")]
//        [InlineData(AccountType.Borrower)]
//        [InlineData(AccountType.Lender)]
//        async Task PingUser(AccountType accountType)
//        {
//            await SigninNewUser(accountType);

//            var res = (await Request<JObject>("Ping/OptionalUser")).Object;
//            Assert.True(res["value"].Value<long>() > 0);
//        }

//        [Theory(DisplayName = "Ping Mandatory User with user token")]
//        [InlineData(AccountType.Borrower)]
//        [InlineData(AccountType.Lender)]
//        async Task PingSecureUser(AccountType accountType)
//        {
//            await SigninNewUser(accountType);

//            var res = (await Request<JObject>("Ping/MandatoryUser")).Object;
//            Assert.True(res["value"].Value<long>() > 0);
//        }

//        [Fact(DisplayName = "Ping Mandatory User with consumer token")]
//        async Task PingSecureConsumer()
//        {
//            await AuthorizeApiConsumer();
//            var res = await Request<JObject>("Ping/MandatoryUser");
//            Assert.Equal(HttpStatusCode.Forbidden, res.HttpResponse.StatusCode);
//        }
//    }
//}
