public void NullSigner() { var args = new FirebaseTokenFactory.Args { Signer = null, }; Assert.Throws <ArgumentNullException>(() => new FirebaseTokenFactory(args)); }
public void EmptyTenantId() { var args = new FirebaseTokenFactory.Args { Signer = Signer, TenantId = string.Empty, }; Assert.Throws <ArgumentException>(() => new FirebaseTokenFactory(args)); }
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)); }
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); }
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); }