Esempio n. 1
0
        public void TearDown()
        {
            try
            {
                var settings = TestFactory.CreateConnectionSettings();
                Console.WriteLine("Delete the database on FixtureTearDown: " + settings.DatabaseId);
                var client = RepositoryHelper.CreateClient(settings);

                //delete the database to save on storage:
                Database database = client.CreateDatabaseQuery()
                                    .Where(db => db.Id == settings.DatabaseId)
                                    .AsEnumerable()
                                    .FirstOrDefault();

                if (database != null)
                {
                    client.DeleteDatabaseAsync(database.SelfLink).Wait();
                }
            }
            catch (Exception exc)
            {
                Console.WriteLine("Could not delete the database on FictureTearDown: " + exc.Message);
            }
        }