mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
Cleanup Projects (#1324)
* Update bitwarden_license projects * Added tests to verify resource names * Remove unneeded assembly attributes * Standardized namespace * Remove .GetTypeInfo()
This commit is contained in:
parent
b150f5977e
commit
0e1ab99e25
@ -15,6 +15,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
.gitignore = .gitignore
|
||||
build.sh = build.sh
|
||||
.github\workflows\build.yml = .github\workflows\build.yml
|
||||
Directory.Build.props = Directory.Build.props
|
||||
dotnet-tools.json = dotnet-tools.json
|
||||
LICENSE.txt = LICENSE.txt
|
||||
LICENSE_AGPL.txt = LICENSE_AGPL.txt
|
||||
@ -22,7 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
NuGet.Config = NuGet.Config
|
||||
README.md = README.md
|
||||
SECURITY.md = SECURITY.md
|
||||
Directory.Build.props = Directory.Build.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Core", "src\Core\Core.csproj", "{3973D21B-A692-4B60-9B70-3631C057423A}"
|
||||
@ -61,6 +61,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Portal", "bitwarden_license
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sso", "bitwarden_license\src\Sso\Sso.csproj", "{4866AF64-6640-4C65-A662-A31E02FF9064}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Icons.Test", "test\Icons.Test\Icons.Test.csproj", "{C7BA2255-C1B1-4789-8BB9-C27540DA6FB8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -137,6 +139,10 @@ Global
|
||||
{4866AF64-6640-4C65-A662-A31E02FF9064}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4866AF64-6640-4C65-A662-A31E02FF9064}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4866AF64-6640-4C65-A662-A31E02FF9064}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C7BA2255-C1B1-4789-8BB9-C27540DA6FB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C7BA2255-C1B1-4789-8BB9-C27540DA6FB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C7BA2255-C1B1-4789-8BB9-C27540DA6FB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C7BA2255-C1B1-4789-8BB9-C27540DA6FB8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@ -159,6 +165,7 @@ Global
|
||||
{860DE301-0B3E-4717-9C21-A9B4C3C2B121} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84F}
|
||||
{BA852F18-852F-4154-973B-77D577B8CA04} = {4FDB6543-F68B-4202-9EA6-7FEA984D2D0A}
|
||||
{4866AF64-6640-4C65-A662-A31E02FF9064} = {4FDB6543-F68B-4202-9EA6-7FEA984D2D0A}
|
||||
{C7BA2255-C1B1-4789-8BB9-C27540DA6FB8} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84F}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E01CBF68-2E20-425F-9EDB-E0A6510CA92F}
|
||||
|
@ -1,9 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.41.2</Version>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>Bit.Portal</RootNamespace>
|
||||
<UserSecretsId>bitwarden-Portal</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -2,4 +2,3 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
[assembly: ResourceLocation("Resources")]
|
||||
[assembly: RootNamespace("Bit.Portal")]
|
||||
|
@ -1,9 +1,6 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.41.2</Version>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<RootNamespace>Bit.Sso</RootNamespace>
|
||||
<UserSecretsId>bitwarden-Sso</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -2,4 +2,3 @@
|
||||
using Microsoft.Extensions.Localization;
|
||||
|
||||
[assembly: ResourceLocation("Resources")]
|
||||
[assembly: RootNamespace("Bit.Core")]
|
||||
|
@ -1,9 +1,9 @@
|
||||
using Bit.Core.Models.Table;
|
||||
using Bit.Core.Models.Table;
|
||||
using Bit.Core.Test.AutoFixture.CipherFixtures;
|
||||
using Newtonsoft.Json;
|
||||
using Xunit;
|
||||
|
||||
namespace Core.Test.Models
|
||||
namespace Bit.Core.Test.Models
|
||||
{
|
||||
public class CipherTests
|
||||
{
|
||||
|
29
test/Core.Test/Resources/VerifyResources.cs
Normal file
29
test/Core.Test/Resources/VerifyResources.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Utilities;
|
||||
using Xunit;
|
||||
|
||||
namespace Bit.Core.Test.Resources
|
||||
{
|
||||
public class VerifyResources
|
||||
{
|
||||
[Theory]
|
||||
[MemberData(nameof(GetResources))]
|
||||
public void Resource_FoundAndReadable(string resourceName)
|
||||
{
|
||||
var assembly = typeof(CoreHelpers).Assembly;
|
||||
|
||||
using (var resource = assembly.GetManifestResourceStream(resourceName))
|
||||
{
|
||||
Assert.NotNull(resource);
|
||||
Assert.True(resource.CanRead);
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> GetResources()
|
||||
{
|
||||
yield return new[] { "Bit.Core.licensing.cer" };
|
||||
yield return new[] { "Bit.Core.MailTemplates.Handlebars.AddedCredit.html.hbs" };
|
||||
yield return new[] { "Bit.Core.MailTemplates.Handlebars.Layouts.Basic.html.hbs" };
|
||||
}
|
||||
}
|
||||
}
|
21
test/Icons.Test/Icons.Test.csproj
Normal file
21
test/Icons.Test/Icons.Test.csproj
Normal file
@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
|
||||
<PackageReference Include="NSubstitute" Version="4.2.2" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Icons\Icons.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
21
test/Icons.Test/Resources/VerifyResources.cs
Normal file
21
test/Icons.Test/Resources/VerifyResources.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System.Reflection;
|
||||
using Xunit;
|
||||
|
||||
namespace Bit.Icons.Test.Resources
|
||||
{
|
||||
public class VerifyResources
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Bit.Icons.Resources.public_suffix_list.dat")]
|
||||
public void Resources_FoundAndReadable(string resourceName)
|
||||
{
|
||||
var assembly = typeof(Program).Assembly;
|
||||
|
||||
using (var resource = assembly.GetManifestResourceStream(resourceName))
|
||||
{
|
||||
Assert.NotNull(resource);
|
||||
Assert.True(resource.CanRead);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user