public void TestShowSnapshot()
        {
            IBlockStorageProvider  provider  = Bootstrapper.CreateBlockStorageProvider();
            IEnumerable <Snapshot> snapshots = provider.ListSnapshots();

            Assert.IsNotNull(snapshots);
            if (!snapshots.Any())
            {
                Assert.Inconclusive("The test could not proceed because the specified account and/or region does not appear to contain any snapshots.");
            }

            Console.WriteLine("Snapshots");
            foreach (Snapshot snapshot in snapshots)
            {
                Assert.IsNotNull(snapshot);
                Assert.IsFalse(string.IsNullOrEmpty(snapshot.Id));
                Snapshot showSnapshot = provider.ShowSnapshot(snapshot.Id);
                Assert.IsNotNull(showSnapshot);
                Assert.AreEqual(snapshot.CreatedAt, showSnapshot.CreatedAt);
                Assert.AreEqual(snapshot.DisplayDescription, showSnapshot.DisplayDescription);
                Assert.AreEqual(snapshot.DisplayName, showSnapshot.DisplayName);
                Assert.AreEqual(snapshot.Id, showSnapshot.Id);
                Assert.AreEqual(snapshot.Size, showSnapshot.Size);
                //Assert.AreEqual(snapshot.Status, showSnapshot.Status);
                Assert.AreEqual(snapshot.VolumeId, showSnapshot.VolumeId);
            }
        }
        public void TestListSnapshots()
        {
            IBlockStorageProvider  provider  = Bootstrapper.CreateBlockStorageProvider();
            IEnumerable <Snapshot> snapshots = provider.ListSnapshots();

            Assert.IsNotNull(snapshots);
            if (!snapshots.Any())
            {
                Assert.Inconclusive("The test could not proceed because the specified account and/or region does not appear to contain any snapshots.");
            }

            Console.WriteLine("Snapshots");
            foreach (Snapshot snapshot in snapshots)
            {
                Assert.IsNotNull(snapshot);
                Assert.IsFalse(string.IsNullOrEmpty(snapshot.Id));
                Console.WriteLine(JsonConvert.SerializeObject(snapshot, Formatting.Indented));
            }
        }
        public void CleanupTestSnapshots()
        {
            IBlockStorageProvider  provider  = Bootstrapper.CreateBlockStorageProvider();
            IEnumerable <Snapshot> snapshots = provider.ListSnapshots();

            foreach (Snapshot snapshot in snapshots)
            {
                if (string.IsNullOrEmpty(snapshot.DisplayName))
                {
                    continue;
                }

                if (!snapshot.DisplayName.StartsWith(UnitTestSnapshotPrefix))
                {
                    continue;
                }

                Console.WriteLine("Deleting unit test snapshot... {0} ({1})", snapshot.DisplayName, snapshot.Id);
                provider.DeleteSnapshot(snapshot.Id);
            }
        }