コード例 #1
0
ファイル: LocalDeviceTests.cs プロジェクト: ably/ably-dotnet
        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);
        }
コード例 #2
0
ファイル: PushTestHelpers.cs プロジェクト: ably/ably-dotnet
        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);
        }