Skip to content

Commit 75a4fd5

Browse files
#8208: Adopt the Orchard Core .editorconfig (#8868)
* Updating .editorconfig from Orchard Core * VS code cleanup, round 1 - Apply expression/block body preference - Apply language/framework type preferences - Apply null checking preferences - Apply using directive placement preferences - Apply using statement preferences - Format document - Remove unnecessary imports or usings - Sort Imports or usings * VS code cleanup: Apply auto property preferences * VS code cleanup: Apply parenthesis preferences * VS code cleanup: Apply object/collection initializer preferences * Reverting NHibernate.Linq changes * Removing commented out RecipeResultRecord class
1 parent 782389e commit 75a4fd5

File tree

3,607 files changed

+70588
-42511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,607 files changed

+70588
-42511
lines changed

src/.editorconfig

Lines changed: 385 additions & 5 deletions
Large diffs are not rendered by default.

src/Orchard.Azure.Tests/AzureVirtualEnvironmentTest.cs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
using Microsoft.WindowsAzure.Storage;
1+
using Microsoft.WindowsAzure.Storage;
22
using Microsoft.WindowsAzure.Storage.Blob;
33
using NUnit.Framework;
44
using Orchard.Azure.Services.Environment.Configuration;
55

6-
namespace Orchard.Azure.Tests {
7-
public abstract class AzureVirtualEnvironmentTest {
6+
namespace Orchard.Azure.Tests
7+
{
8+
public abstract class AzureVirtualEnvironmentTest
9+
{
810
protected IPlatformConfigurationAccessor PlatformConfigurationAccessor = new DefaultPlatformConfigurationAccessor();
911
protected abstract string StorageConnectionStringName { get; }
1012
protected CloudStorageAccount DevAccount { get; private set; }
1113

1214
protected abstract void OnInit();
1315

1416
[OneTimeSetUp]
15-
public void FixtureSetup() {
17+
public void FixtureSetup()
18+
{
1619
var connectionString = PlatformConfigurationAccessor.GetSetting(StorageConnectionStringName, "default", "");
1720

1821
CloudStorageAccount.TryParse(connectionString, out CloudStorageAccount devAccount);
@@ -21,28 +24,36 @@ public void FixtureSetup() {
2124
OnInit();
2225
}
2326

24-
protected void DeleteAllBlobs(string containerName, CloudStorageAccount account) {
27+
protected void DeleteAllBlobs(string containerName, CloudStorageAccount account)
28+
{
2529
var blobClient = account.CreateCloudBlobClient();
2630
var container = blobClient.GetContainerReference(containerName);
2731

28-
foreach (var blob in container.ListBlobs()) {
29-
if (blob is CloudBlob blobLeaf) {
32+
foreach (var blob in container.ListBlobs())
33+
{
34+
if (blob is CloudBlob blobLeaf)
35+
{
3036
blobLeaf.DeleteIfExists();
3137
}
3238

33-
if (blob is CloudBlobDirectory directory) {
39+
if (blob is CloudBlobDirectory directory)
40+
{
3441
DeleteAllBlobs(directory);
3542
}
3643
}
3744
}
3845

39-
private static void DeleteAllBlobs(CloudBlobDirectory cloudBlobDirectory) {
40-
foreach (var blob in cloudBlobDirectory.ListBlobs()) {
41-
if (blob is CloudBlob blobLeaf) {
46+
private static void DeleteAllBlobs(CloudBlobDirectory cloudBlobDirectory)
47+
{
48+
foreach (var blob in cloudBlobDirectory.ListBlobs())
49+
{
50+
if (blob is CloudBlob blobLeaf)
51+
{
4252
blobLeaf.DeleteIfExists();
4353
}
4454

45-
if (blob is CloudBlobDirectory directory) {
55+
if (blob is CloudBlobDirectory directory)
56+
{
4657
DeleteAllBlobs(directory);
4758
}
4859
}

src/Orchard.Azure.Tests/Environment/Configuration/AzureShellSettingsManagerTests.cs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1-
using System.Linq;
1+
using System.Linq;
22
using NUnit.Framework;
33
using Orchard.Azure.Services.Environment.Configuration;
44
using Orchard.Environment.Configuration;
55
using Orchard.FileSystems.Media;
66

7-
namespace Orchard.Azure.Tests.Environment.Configuration {
7+
namespace Orchard.Azure.Tests.Environment.Configuration
8+
{
89
[TestFixture]
9-
public class AzureShellSettingsManagerTests : AzureVirtualEnvironmentTest {
10+
public class AzureShellSettingsManagerTests : AzureVirtualEnvironmentTest
11+
{
1012
private IShellSettingsManager _shellSettingsManager;
1113

1214
protected override string StorageConnectionStringName { get; } = Constants.ShellSettingsStorageConnectionStringSettingName;
1315

14-
protected override void OnInit() {
16+
protected override void OnInit()
17+
{
1518
_shellSettingsManager = new AzureBlobShellSettingsManager(
1619
new Moq.Mock<IMimeTypeProvider>().Object,
1720
new Moq.Mock<IShellSettingsManagerEventHandler>().Object);
1821
}
1922

2023
[SetUp]
21-
public void Setup() {
24+
public void Setup()
25+
{
2226
// ensure default container is empty before running any test
2327
DeleteAllBlobs(Constants.ShellSettingsDefaultContainerName, DevAccount);
2428
}
2529

2630
[TearDown]
27-
public void TearDown() {
31+
public void TearDown()
32+
{
2833
// ensure default container is empty after running tests
2934
DeleteAllBlobs(Constants.ShellSettingsDefaultContainerName, DevAccount);
3035
}
3136

3237
[Test]
33-
public void SingleSettingsFileShouldComeBackAsExpected() {
38+
public void SingleSettingsFileShouldComeBackAsExpected()
39+
{
3440

3541
_shellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" });
3642

@@ -42,7 +48,8 @@ public void SingleSettingsFileShouldComeBackAsExpected() {
4248
}
4349

4450
[Test]
45-
public void SettingsShouldBeOverwritable() {
51+
public void SettingsShouldBeOverwritable()
52+
{
4653
_shellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" });
4754
_shellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe2", DataConnectionString = "something else2" });
4855

@@ -54,7 +61,8 @@ public void SettingsShouldBeOverwritable() {
5461
}
5562

5663
[Test]
57-
public void MultipleFilesCanBeDetected() {
64+
public void MultipleFilesCanBeDetected()
65+
{
5866

5967
_shellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLCe", DataConnectionString = "something else" });
6068
_shellSettingsManager.SaveSettings(new ShellSettings { Name = "Another", DataProvider = "SQLCe2", DataConnectionString = "something else2" });
@@ -74,7 +82,8 @@ public void MultipleFilesCanBeDetected() {
7482
}
7583

7684
[Test]
77-
public void NewSettingsCanBeStored() {
85+
public void NewSettingsCanBeStored()
86+
{
7887
_shellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLite", DataConnectionString = "something else" });
7988

8089
var foo = new ShellSettings { Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux" };
@@ -90,7 +99,8 @@ public void NewSettingsCanBeStored() {
9099
}
91100

92101
[Test]
93-
public void SettingsCanContainSeparatorChar() {
102+
public void SettingsCanContainSeparatorChar()
103+
{
94104
_shellSettingsManager.SaveSettings(new ShellSettings { Name = "Default", DataProvider = "SQLite", DataConnectionString = "Server=tcp:tjyptm5sfc.database.windows.net;Database=orchard;User ID=foo@bar;Password=foo;Trusted_Connection=False;Encrypt=True;" });
95105

96106
var settings = _shellSettingsManager.LoadSettings().Where(s => s.Name == "Default").Single();

0 commit comments

Comments
 (0)