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

            client.CreateDatabase(new CreateDatabaseRequest());
            Assert.Null(invoker.Metadata.FirstOrDefault(e => e.Key == ResourcePrefixHeader));
        }
Beispiel #2
0
        public void SetsHeaderOnCreateDatabase()
        {
            var invoker = new FakeCallInvoker();
            var client = new DatabaseAdminClientBuilder {
                CallInvoker = invoker
            }.Build();

            client.CreateDatabase(new CreateDatabaseRequest {
                Parent = SampleInstanceName
            });
            Metadata.Entry entry = Assert.Single(invoker.Metadata, e => e.Key == ResourcePrefixHeader);
            Assert.Equal(SampleInstanceName, entry.Value);
        }