Пример #1
0
        public void Dispose()
        {
            if (DatabaseServer.Subscription == null)
            {
                return;
            }
            Debug.WriteLine("Dropping server...");
            DatabaseServer.DropAsync().Wait();

            // Verify the deletion only if we're testing the database server itself.
            if (GetType() == typeof(DatabaseServerTests))
            {
                VerifyDeletion();
            }
        }
Пример #2
0
        private async Task TeardownImpl()
        {
            await Task.Run(async() =>
            {
                try
                {
                    await DropReplicas(SoutheastAsiaDatabaseServer);
                    await DropReplicas(EastAsiaDatabaseServer);
                    await DropReplicas(AustraliaDatabaseServer);

                    await SoutheastAsiaDatabaseServer.DropAsync();
                    await EastAsiaDatabaseServer.DropAsync();
                    await AustraliaDatabaseServer.DropAsync();
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e);
                }
            });
        }
Пример #3
0
        private async Task TeardownImpl()
        {
            await Task.Run(async() =>
            {
                if (DatabaseServer.Subscription == null)
                {
                    return;
                }

                try
                {
                    Debug.WriteLine("Dropping server...");
                    await DatabaseServer.DropAsync();
                    var deletedServer = (await Subscription.DatabaseServers.AsTask()).SingleOrDefault(d => d.Name == DatabaseServer.Name);
                    Assert.IsNull(deletedServer);
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e);
                }
            });
        }