mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Orchard.Azure.Tests: Code styling in AzureVirtualEnvironmentTest.cs
This commit is contained in:
@@ -11,10 +11,11 @@ namespace Orchard.Azure.Tests {
|
||||
|
||||
protected abstract void OnInit();
|
||||
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void FixtureSetup() {
|
||||
var count = Process.GetProcessesByName("DSService").Length;
|
||||
if ( count == 0 ) {
|
||||
if (count == 0) {
|
||||
var start = new ProcessStartInfo {
|
||||
Arguments = "/devstore:start",
|
||||
FileName = Path.Combine(ConfigurationManager.AppSettings["AzureSDK"], @"emulator\csrun.exe")
|
||||
@@ -30,34 +31,32 @@ namespace Orchard.Azure.Tests {
|
||||
|
||||
[TestFixtureTearDown]
|
||||
public void FixtureTearDown() {
|
||||
|
||||
if ( _dsService != null )
|
||||
if (_dsService != null)
|
||||
_dsService.Close();
|
||||
}
|
||||
|
||||
protected void DeleteAllBlobs(string containerName, CloudStorageAccount account)
|
||||
{
|
||||
protected void DeleteAllBlobs(string containerName, CloudStorageAccount account) {
|
||||
var blobClient = account.CreateCloudBlobClient();
|
||||
var container = blobClient.GetContainerReference(containerName);
|
||||
|
||||
foreach ( var blob in container.ListBlobs() ) {
|
||||
if ( blob is CloudBlob ) {
|
||||
( (CloudBlob)blob ).DeleteIfExists();
|
||||
foreach (var blob in container.ListBlobs()) {
|
||||
if (blob is CloudBlob) {
|
||||
((CloudBlob)blob).DeleteIfExists();
|
||||
}
|
||||
|
||||
if ( blob is CloudBlobDirectory ) {
|
||||
if (blob is CloudBlobDirectory) {
|
||||
DeleteAllBlobs((CloudBlobDirectory)blob);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void DeleteAllBlobs(CloudBlobDirectory cloudBlobDirectory) {
|
||||
foreach ( var blob in cloudBlobDirectory.ListBlobs() ) {
|
||||
if ( blob is CloudBlob ) {
|
||||
( (CloudBlob)blob ).DeleteIfExists();
|
||||
foreach (var blob in cloudBlobDirectory.ListBlobs()) {
|
||||
if (blob is CloudBlob) {
|
||||
((CloudBlob)blob).DeleteIfExists();
|
||||
}
|
||||
|
||||
if ( blob is CloudBlobDirectory ) {
|
||||
if (blob is CloudBlobDirectory) {
|
||||
DeleteAllBlobs((CloudBlobDirectory)blob);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user