mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
[PM-1011] LaunchDarkly service (#2726)
* LaunchDarkly service * Load file-based flag values, properly support offline only when self-host * Simplify tests * Use interface for LD settings * Remove tests that will provide inconsistent results depending on machine setup and file fallback * Fall back to offline mode more actively * Drive fallback file path with setting
This commit is contained in:
28
test/Core.Test/Services/LaunchDarklyFeatureServiceTests.cs
Normal file
28
test/Core.Test/Services/LaunchDarklyFeatureServiceTests.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using AutoFixture;
|
||||
using Bit.Core.Services;
|
||||
using Bit.Core.Settings;
|
||||
using Bit.Test.Common.AutoFixture;
|
||||
using Bit.Test.Common.AutoFixture.Attributes;
|
||||
using Xunit;
|
||||
|
||||
namespace Bit.Core.Test.Services;
|
||||
|
||||
[SutProviderCustomize]
|
||||
public class LaunchDarklyFeatureServiceTests
|
||||
{
|
||||
public static SutProvider<LaunchDarklyFeatureService> GetSutProvider(IGlobalSettings globalSettings)
|
||||
{
|
||||
var fixture = new Fixture();
|
||||
return new SutProvider<LaunchDarklyFeatureService>(fixture)
|
||||
.SetDependency<IGlobalSettings>(globalSettings)
|
||||
.Create();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Offline_WhenSelfHost()
|
||||
{
|
||||
var sutProvider = GetSutProvider(new Core.Settings.GlobalSettings() { SelfHosted = true });
|
||||
|
||||
Assert.False(sutProvider.Sut.IsOnline());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user