public void NoHeaderOnGetDatabaseIfEmptyDatabaseName() { var invoker = new FakeCallInvoker(); var client = new DatabaseAdminClientBuilder { CallInvoker = invoker }.Build(); client.GetDatabase(new GetDatabaseRequest()); Assert.Null(invoker.Metadata.FirstOrDefault(e => e.Key == ResourcePrefixHeader)); }
public void NoHeaderOnGetDatabaseIfInvalidDatabaseName() { var invoker = new FakeCallInvoker(); var client = new DatabaseAdminClientBuilder { CallInvoker = invoker }.Build(); client.GetDatabase(new GetDatabaseRequest { Name = "projects/proj/instances/inst/databases" }); Assert.Null(invoker.Metadata.FirstOrDefault(e => e.Key == ResourcePrefixHeader)); }
public void SetsHeaderOnGetDatabase() { var invoker = new FakeCallInvoker(); var client = new DatabaseAdminClientBuilder { CallInvoker = invoker }.Build(); client.GetDatabase(new GetDatabaseRequest { Name = SampleDatabaseName }); Metadata.Entry entry = Assert.Single(invoker.Metadata, e => e.Key == ResourcePrefixHeader); Assert.Equal(SampleDatabaseName, entry.Value); }