Пример #1
0
        public void provisionDevice()
        {
            using (Tokenio.User.TokenClient remoteDevice = TestUtil.CreateClient())
            {
                Alias      alias        = TestUtil.RandomAlias();
                UserMember remoteMember = remoteDevice.CreateMemberBlocking(alias);
                remoteMember.SubscribeToNotifications("iron");

                Tokenio.User.TokenClient localDeviceClient = TestUtil.CreateClient();
                Key key = ProvisionDeviceSample.ProvisionDevice(localDeviceClient, alias);
                remoteMember.ApproveKeyBlocking(key);

                UserMember local = ProvisionDeviceSample.UseProvisionedDevice(localDeviceClient, alias);

                Assert.Equal(local.MemberId(), remoteMember.MemberId());
            }
        }