mirror of
https://github.com/bitwarden/server
synced 2026-01-16 15:33:19 +00: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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user