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); }
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); }
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); }
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); }
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); }
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. }
void Awake() { _client = new KinClient(Environment.Test, "test"); }
public void TestNullKeyPair() { KinClient kinClient = new KinClient(Kin.Sdk.Environment.Test, keystoreProvider); kinClient.GetAccount(null); }
internal KinAccount(KeyPair keyPair, KinClient client) { this.keyPair = keyPair; this.client = client; }
public void Setup() { _client = new KinClient(Environment.Test, "test"); _client.ClearAllAccounts(); }