1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

enable default appsettings for self hosted installs (#1263)

* enable default appsettings for self hosted installs

* change setters to use arrow functions

* fix tests

* fix global settings ref
This commit is contained in:
Kyle Spearrin
2021-04-09 09:48:43 -04:00
committed by GitHub
parent c1ceeace95
commit 83e68bce06
16 changed files with 373 additions and 82 deletions

View File

@ -0,0 +1,16 @@
using AutoFixture;
namespace Bit.Core.Test.AutoFixture
{
internal class GlobalSettings : ICustomization
{
public void Customize(IFixture fixture)
{
fixture.Customize<Settings.GlobalSettings>(composer => composer
.Without(s => s.BaseServiceUri)
.Without(s => s.Attachment)
.Without(s => s.Send)
.Without(s => s.DataProtection));
}
}
}

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using AutoFixture;
using AutoFixture.Kernel;
@ -21,7 +21,7 @@ namespace Bit.Core.Test.AutoFixture
public SutProvider(IFixture fixture)
{
_dependencies = new Dictionary<Type, Dictionary<string, object>>();
_fixture = (fixture ?? new Fixture()).WithAutoNSubstitutions();
_fixture = (fixture ?? new Fixture()).WithAutoNSubstitutions().Customize(new GlobalSettings());
_constructorParameterRelay = new ConstructorParameterRelay<TSut>(this, _fixture);
_fixture.Customizations.Add(_constructorParameterRelay);
}

View File

@ -43,7 +43,7 @@ namespace Bit.Core.Test.Services
var ssoConfigRepo = Substitute.For<ISsoConfigRepository>();
var ssoUserRepo = Substitute.For<ISsoUserRepository>();
var referenceEventService = Substitute.For<IReferenceEventService>();
var globalSettings = Substitute.For<GlobalSettings>();
var globalSettings = Substitute.For<Settings.GlobalSettings>();
var taxRateRepository = Substitute.For<ITaxRateRepository>();
var orgService = new OrganizationService(orgRepo, orgUserRepo, collectionRepo, userRepo,
@ -105,7 +105,7 @@ namespace Bit.Core.Test.Services
var ssoConfigRepo = Substitute.For<ISsoConfigRepository>();
var ssoUserRepo = Substitute.For<ISsoUserRepository>();
var referenceEventService = Substitute.For<IReferenceEventService>();
var globalSettings = Substitute.For<GlobalSettings>();
var globalSettings = Substitute.For<Settings.GlobalSettings>();
var taxRateRepo = Substitute.For<ITaxRateRepository>();
var orgService = new OrganizationService(orgRepo, orgUserRepo, collectionRepo, userRepo,