1
0
mirror of https://github.com/bitwarden/server synced 2026-01-02 00:23:40 +00:00

Run dotnet format (#1764)

This commit is contained in:
Oscar Hinton
2021-12-16 15:35:09 +01:00
committed by GitHub
parent 61dc65aa59
commit 23b0a1f9df
531 changed files with 3024 additions and 3000 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
@@ -46,12 +46,12 @@ namespace Bit.Core.Test.AutoFixture.CipherFixtures
}
}
internal class CipherBuilder: ISpecimenBuilder
internal class CipherBuilder : ISpecimenBuilder
{
public bool OrganizationOwned { get; set; }
public object Create(object request, ISpecimenContext context)
{
if (context == null)
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
@@ -78,11 +78,12 @@ namespace Bit.Core.Test.AutoFixture.CipherFixtures
.Without(e => e.Favorites)
.Without(e => e.Folders));
//
var serializerOptions = new JsonSerializerOptions(){
var serializerOptions = new JsonSerializerOptions()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase
};
if(type == typeof(Cipher))
if (type == typeof(Cipher))
{
var obj = fixture.WithAutoNSubstitutions().Create<Cipher>();
var cipherData = fixture.WithAutoNSubstitutions().Create<CipherLoginData>();
@@ -92,10 +93,10 @@ namespace Bit.Core.Test.AutoFixture.CipherFixtures
return obj;
}
if (type == typeof(List<Cipher>))
if (type == typeof(List<Cipher>))
{
var ciphers = fixture.WithAutoNSubstitutions().CreateMany<Cipher>().ToArray();
for (var i = 0; i < ciphers.Count(); i++ )
for (var i = 0; i < ciphers.Count(); i++)
{
var cipherData = fixture.WithAutoNSubstitutions().Create<CipherLoginData>();
var cipherAttachements = fixture.WithAutoNSubstitutions().Create<List<CipherAttachment>>();
@@ -110,14 +111,15 @@ namespace Bit.Core.Test.AutoFixture.CipherFixtures
}
}
internal class EfCipher: ICustomization
internal class EfCipher : ICustomization
{
public bool OrganizationOwned { get; set; }
public void Customize(IFixture fixture)
{
fixture.Customizations.Add(new GlobalSettingsBuilder());
fixture.Customizations.Add(new CipherBuilder(){
OrganizationOwned = OrganizationOwned
fixture.Customizations.Add(new CipherBuilder()
{
OrganizationOwned = OrganizationOwned
});
fixture.Customizations.Add(new UserBuilder());
fixture.Customizations.Add(new OrganizationBuilder());
@@ -172,9 +174,10 @@ namespace Bit.Core.Test.AutoFixture.CipherFixtures
internal class EfOrganizationCipherAutoDataAttribute : CustomAutoDataAttribute
{
public EfOrganizationCipherAutoDataAttribute() : base(new SutProviderCustomization(), new EfCipher(){
OrganizationOwned = true,
})
public EfOrganizationCipherAutoDataAttribute() : base(new SutProviderCustomization(), new EfCipher()
{
OrganizationOwned = true,
})
{ }
}