Exemple #1
0
        public void NullSigner()
        {
            var args = new FirebaseTokenFactory.Args
            {
                Signer = null,
            };

            Assert.Throws <ArgumentNullException>(() => new FirebaseTokenFactory(args));
        }
Exemple #2
0
        public void EmptyTenantId()
        {
            var args = new FirebaseTokenFactory.Args
            {
                Signer   = Signer,
                TenantId = string.Empty,
            };

            Assert.Throws <ArgumentException>(() => new FirebaseTokenFactory(args));
        }
Exemple #3
0
        private static FirebaseTokenFactory CreateTokenFactory(string tenantId)
        {
            var args = new FirebaseTokenFactory.Args
            {
                Signer   = Signer,
                Clock    = Clock,
                TenantId = tenantId,
            };

            return(new FirebaseTokenFactory(args));
        }
        private FirebaseTokenFactory CreateTokenFactory()
        {
            var args = new FirebaseTokenFactory.Args
            {
                Signer         = this.Signer,
                Clock          = this.Clock,
                TenantId       = this.TenantId,
                IsEmulatorMode = !string.IsNullOrWhiteSpace(this.EmulatorHost),
            };

            return(new FirebaseTokenFactory(args));
        }
Exemple #5
0
        public void SignerOnly()
        {
            var args = new FirebaseTokenFactory.Args
            {
                Signer = Signer,
            };

            var factory = new FirebaseTokenFactory(args);

            Assert.Same(SystemClock.Default, factory.Clock);
            Assert.Null(factory.TenantId);
            Assert.False(factory.IsEmulatorMode);
        }
Exemple #6
0
        public void EmulatorMode(string tenantId)
        {
            var args = new FirebaseTokenFactory.Args
            {
                IsEmulatorMode = true,
                TenantId       = tenantId,
            };
            var factory = new FirebaseTokenFactory(args);

            Assert.True(factory.IsEmulatorMode);
            Assert.Same(EmulatorSigner.Instance, factory.Signer);
            Assert.Same(SystemClock.Default, factory.Clock);
            AssertTenantId(tenantId, factory);
        }