示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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);
        }