Пример #1
0
 public static FirebaseFirestoreSettings ToNative(this FirestoreSettings @this)
 {
     return(new FirebaseFirestoreSettings.Builder()
            .SetHost(@this.Host)
            .SetPersistenceEnabled(@this.IsPersistenceEnabled)
            .SetSslEnabled(@this.IsSslEnabled)
            .SetCacheSizeBytes(@this.CacheSizeBytes)
            .Build());
 }
        private static Mock <FirestoreClient> CreateMockClient()
        {
            var mock = new Mock <FirestoreClient> {
                CallBase = true
            };

            mock.SetupProperty(c => c.Settings, FirestoreSettings.GetDefault());
            return(mock);
        }
Пример #3
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method
            App.Configure();
            FirestoreSettings settings = new FirestoreSettings();

            settings.TimestampsInSnapshotsEnabled = true;
            Firestore.SharedInstance.Settings     = settings;
            return(true);
        }
Пример #4
0
        public static FirestoreDb Create()
        {
            var firestoreHost     = Environment.GetEnvironmentVariable("FIRESTORE_EMULATOR_HOST") ?? "localhost:8080";
            var matches           = Regex.Match(firestoreHost, "(?<host>.*):(?<port>\\d+)");
            var host              = matches.Groups["host"].Value;
            var port              = int.Parse(matches.Groups["port"].Value);
            var firestoreSettings = new FirestoreSettings
            {
                CallSettings = CallSettings.FromHeaderMutation(x => x.Add("Authorization", "Bearer owner"))
            };

            return(FirestoreDb.Create("na",
                                      FirestoreClient.Create(new Channel(host, port, ChannelCredentials.Insecure), firestoreSettings)));
        }
 internal FakeFirestoreClient()
 {
     Settings = FirestoreSettings.GetDefault();
 }
Пример #6
0
 partial void OnConstruction(Firestore.FirestoreClient grpcClient, FirestoreSettings effectiveSettings, ClientHelper clientHelper)
 {
     Settings = effectiveSettings;
 }
Пример #7
0
 /// <summary>
 /// Creates a client which will respond to the first <paramref name="failures"/> commit calls with <paramref name="exception"/>.
 /// </summary>
 public TransactionTestingClient(int failures, Exception exception)
 {
     Settings   = FirestoreSettings.GetDefault();
     _failures  = failures;
     _exception = exception;
 }