Exemplo n.º 1
0
        public async Task TestAddAccount()
        {
            KinClient kinClient = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider);
            KeyPair   keyPair   = await kinClient.AddAccount();

            Assert.AreEqual(1, await keystoreProvider.GetAccountCount());
            Assert.AreEqual(keyPair.AccountId, (await keystoreProvider.GetAccountAtIndex(0)).AccountId);
        }
Exemplo n.º 2
0
        public void TestGetAccount()
        {
            KeyPair   keyPair   = KeyPair.Random();
            KinClient kinClient = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider);

            KinAccount kinAccount = kinClient.GetAccount(keyPair);

            Assert.AreEqual(kinAccount.keyPair, keyPair);
        }
Exemplo n.º 3
0
        public void TestExplicitlyEmptyAppId()
        {
            KinClient client = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider, "");

            Assert.AreEqual(client.AppId, "");

            KinClient client2 = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider, null);

            Assert.AreEqual(client2.AppId, null);
        }
Exemplo n.º 4
0
        public async Task TestAddAccountWithExtras()
        {
            KinClient kinClient = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider);
            Dictionary <string, object> extras = new Dictionary <string, object>();

            extras.Add("PlayerName", "Ron");

            KeyPair keyPair = await kinClient.AddAccount(extras);

            Assert.AreEqual(keyPair.AccountId, keystoreProvider.GetAccountByPlayerName("Ron").AccountId);
        }
Exemplo n.º 5
0
        public void TestValidConstractor()
        {
            KinClient client  = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider);
            KinClient client2 = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider, "abcd");

            Assert.AreEqual(client.AppId, "anon");
            Assert.AreEqual(client2.AppId, "abcd");

            Assert.AreEqual(Kin.Base.Network.Current.NetworkPassphrase, client.Environment.NetworkPassphrase);

            new KinClient(Kin.Sdk.Environment.Production, keystoreProvider);
            Assert.AreEqual(Kin.Base.Network.Current.NetworkPassphrase, Kin.Sdk.Environment.Production.NetworkPassphrase);
        }
Exemplo n.º 6
0
 void Start()
 {
     //https://github.com/kinecosystem/kin-sdk-unity#get-started
     kinClient  = new KinClient(environment, appId); //Declare a new client
     kinAccount = FetchAccount();                    //Return the user's *local* account. If doesn't exist, create it first.
 }
Exemplo n.º 7
0
 void Awake()
 {
     _client = new KinClient(Environment.Test, "test");
 }
Exemplo n.º 8
0
        public void TestNullKeyPair()
        {
            KinClient kinClient = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider);

            kinClient.GetAccount(null);
        }
Exemplo n.º 9
0
 internal KinAccount(KeyPair keyPair, KinClient client)
 {
     this.keyPair = keyPair;
     this.client  = client;
 }
Exemplo n.º 10
0
 public void Setup()
 {
     _client = new KinClient(Environment.Test, "test");
     _client.ClearAllAccounts();
 }