Example #1
0
        public void Create_ShouldCreateRandomDeviceSecretsAndIds()
        {
            var secrets = Enumerable.Range(1, 100)
                          .Select(x => LocalDevice.Create().DeviceSecret)
                          .Distinct();

            var ids = Enumerable.Range(1, 100)
                      .Select(x => LocalDevice.Create().Id)
                      .Distinct();

            secrets.Should().HaveCount(100);
            ids.Should().HaveCount(100);
        }
Example #2
0
        public static LocalDevice GetTestLocalDevice(AblyRest client, string clientId = null)
        {
            var device = LocalDevice.Create(clientId);

            device.FormFactor     = "phone";
            device.Platform       = "android";
            device.Push.Recipient = JObject.FromObject(new
            {
                transportType = "ablyChannel",
                channel       = "pushenabled:test",
                ablyKey       = client.Options.Key,
                ablyUrl       = "https://" + client.Options.FullRestHost(),
            });
            return(device);
        }