mirror of
https://github.com/bitwarden/server.git
synced 2024-12-02 13:53:23 +01:00
dotnet format
This commit is contained in:
parent
9a5f1e2598
commit
5bb005354b
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
using Bit.Core.AdminConsole.Entities;
|
using Bit.Core.AdminConsole.Entities;
|
||||||
using Bit.Core.AdminConsole.Enums;
|
using Bit.Core.AdminConsole.Enums;
|
||||||
using Bit.Core.Entities;
|
|
||||||
|
|
||||||
namespace Bit.Core.AdminConsole.OrganizationFeatures.Policies;
|
namespace Bit.Core.AdminConsole.OrganizationFeatures.Policies;
|
||||||
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
||||||
using System.ComponentModel;
|
|
||||||
using Bit.Core.AdminConsole.Entities;
|
using Bit.Core.AdminConsole.Entities;
|
||||||
using Bit.Core.AdminConsole.Enums;
|
using Bit.Core.AdminConsole.Enums;
|
||||||
using Bit.Core.AdminConsole.Repositories;
|
|
||||||
using Bit.Core.Auth.Enums;
|
using Bit.Core.Auth.Enums;
|
||||||
using Bit.Core.Auth.Repositories;
|
using Bit.Core.Auth.Repositories;
|
||||||
using Bit.Core.Context;
|
using Bit.Core.Context;
|
||||||
using Bit.Core.Entities;
|
|
||||||
using Bit.Core.Enums;
|
using Bit.Core.Enums;
|
||||||
using Bit.Core.Exceptions;
|
using Bit.Core.Exceptions;
|
||||||
using Bit.Core.Repositories;
|
using Bit.Core.Repositories;
|
||||||
|
@ -82,9 +82,9 @@ public class PolicyServicevNext : IPolicyServicevNext
|
|||||||
.Where(otherPolicy => otherPolicy is { Enabled: true })
|
.Where(otherPolicy => otherPolicy is { Enabled: true })
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
if (dependentPolicies is { Count: > 0})
|
if (dependentPolicies is { Count: > 0 })
|
||||||
{
|
{
|
||||||
throw new BadRequestException("This policy is required by " + dependentPolicies.First()!.Type + " policy. Try disabling that policy first." );
|
throw new BadRequestException("This policy is required by " + dependentPolicies.First()!.Type + " policy. Try disabling that policy first.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using AutoFixture;
|
|
||||||
using AutoFixture.Kernel;
|
using AutoFixture.Kernel;
|
||||||
using Bit.Core.AdminConsole.OrganizationFeatures.Policies;
|
using Bit.Core.AdminConsole.OrganizationFeatures.Policies;
|
||||||
using Bit.Core.AdminConsole.Services.Implementations;
|
using Bit.Core.AdminConsole.Services.Implementations;
|
||||||
using Bit.Test.Common.AutoFixture.Attributes;
|
|
||||||
|
|
||||||
namespace Bit.Core.Test.AdminConsole.AutoFixture;
|
namespace Bit.Core.Test.AdminConsole.AutoFixture;
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ using Bit.Core.Test.AdminConsole.AutoFixture;
|
|||||||
using Bit.Test.Common.AutoFixture;
|
using Bit.Test.Common.AutoFixture;
|
||||||
using Bit.Test.Common.AutoFixture.Attributes;
|
using Bit.Test.Common.AutoFixture.Attributes;
|
||||||
using NSubstitute;
|
using NSubstitute;
|
||||||
using NSubstitute.ReceivedExtensions;
|
|
||||||
using Xunit;
|
using Xunit;
|
||||||
using EventType = Bit.Core.Enums.EventType;
|
using EventType = Bit.Core.Enums.EventType;
|
||||||
|
|
||||||
@ -99,7 +98,7 @@ public class PolicyServicevNextTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Theory, BitAutoData]
|
[Theory, BitAutoData]
|
||||||
public async Task SaveAsync_PolicyDefinitionNotFound_Throws([Policy(PolicyType.SingleOrg)]Policy policy)
|
public async Task SaveAsync_PolicyDefinitionNotFound_Throws([Policy(PolicyType.SingleOrg)] Policy policy)
|
||||||
{
|
{
|
||||||
var sutProvider = SutProviderFactory();
|
var sutProvider = SutProviderFactory();
|
||||||
ArrangeOrganization(sutProvider, policy);
|
ArrangeOrganization(sutProvider, policy);
|
||||||
|
Loading…
Reference in New Issue
Block a user