Example #1
0
        public void NoHeaderOnGetBackupIfEmptyBackupName()
        {
            var invoker = new FakeCallInvoker();
            var client = new DatabaseAdminClientBuilder {
                CallInvoker = invoker
            }.Build();

            client.GetBackup(new GetBackupRequest());
            Assert.Null(invoker.Metadata.FirstOrDefault(e => e.Key == ResourcePrefixHeader));
        }
Example #2
0
        public void NoHeaderOnGetBackupIfInvalidBackupName()
        {
            var invoker = new FakeCallInvoker();
            var client = new DatabaseAdminClientBuilder {
                CallInvoker = invoker
            }.Build();

            client.GetBackup(new GetBackupRequest {
                Name = "projects/proj/instances/inst/backups"
            });
            Assert.Null(invoker.Metadata.FirstOrDefault(e => e.Key == ResourcePrefixHeader));
        }
Example #3
0
        public void SetsHeaderOnGetBackup()
        {
            var invoker = new FakeCallInvoker();
            var client = new DatabaseAdminClientBuilder {
                CallInvoker = invoker
            }.Build();

            client.GetBackup(new GetBackupRequest {
                Name = SampleBackupName
            });
            Metadata.Entry entry = Assert.Single(invoker.Metadata, e => e.Key == ResourcePrefixHeader);
            Assert.Equal(SampleInstanceName, entry.Value);
        }