12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using JsonRpcLite.Network;
- using JsonRpcLite.Rpc;
- using System;
- using System.Net;
- using WingInterfaceLibrary.Enum;
- using WingInterfaceLibrary.Interface;
- using WingInterfaceLibrary.Request.User;
- namespace Flyinsono.Client.Test
- {
- internal interface IClientTestManager : IClientManager
- {
- /// <summary>
- /// Run the test cases
- /// </summary>
- void Run(string remoteUrl);
- }
- internal class ClientTestManager : IClientTestManager
- {
- public async void Run(string remoteUrl)
- {
- try {
-
- var clientEngine = new JsonRpcHttpClientEngine(remoteUrl);
- var client = new JsonRpcClient();
- client.UseEngine(clientEngine);
- var proxy = client.CreateProxy<ILoginService>();
- var request = new CommonLoginRequest();
- request.LoginSource = LoginSource.PC;
- request.AnyAccount = "fly11";
- request.Password = "7a9da7f9ffc92a1d9e3b9d87137eb3c1";
- var result = await proxy.CommonLoginAsync(request);
- Logger.WriteLineInfo($"result:{result.AccountName}- {result.LoginState} - {result.Token}");
- }
- catch(Exception ex)
- {
- Logger.WriteLineError($"Test run ex:{ex}");
- }
-
- }
- public void Dispose()
- {
- //throw new System.NotImplementedException();
- }
- }
- }
|