Skip to content

Commit

Permalink
Add common tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lyarenei committed Sep 28, 2024
1 parent 0372c66 commit 9532230
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 22 deletions.
7 changes: 7 additions & 0 deletions Jellyfin.Plugin.ListenBrainz.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Plugin.ListenBrain
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Plugin.ListenBrainz.Common", "src\Jellyfin.Plugin.ListenBrainz.Common\Jellyfin.Plugin.ListenBrainz.Common.csproj", "{9EB1DCAD-69EE-4AAF-813C-454FB8E87417}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Plugin.ListenBrainz.Common.Tests", "tests\Jellyfin.Plugin.ListenBrainz.Common.Tests\Jellyfin.Plugin.ListenBrainz.Common.Tests.csproj", "{DD927BBD-0175-47BC-95DC-B3AA7B2CDBE1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -64,6 +66,10 @@ Global
{9EB1DCAD-69EE-4AAF-813C-454FB8E87417}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9EB1DCAD-69EE-4AAF-813C-454FB8E87417}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9EB1DCAD-69EE-4AAF-813C-454FB8E87417}.Release|Any CPU.Build.0 = Release|Any CPU
{DD927BBD-0175-47BC-95DC-B3AA7B2CDBE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD927BBD-0175-47BC-95DC-B3AA7B2CDBE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD927BBD-0175-47BC-95DC-B3AA7B2CDBE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD927BBD-0175-47BC-95DC-B3AA7B2CDBE1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{33145D22-8C66-4C69-A409-3934840EAF4C} = {BCFEC1CA-66E1-462A-BFA8-00D61DCCD970}
Expand All @@ -75,5 +81,6 @@ Global
{5E3664B9-03C9-4357-86C5-B9B6E18C1098} = {BCFEC1CA-66E1-462A-BFA8-00D61DCCD970}
{773CDB41-E866-439A-A6F1-79308AF97AB8} = {99C564F4-BF8F-4555-AAB7-3A379C784CC4}
{9EB1DCAD-69EE-4AAF-813C-454FB8E87417} = {BCFEC1CA-66E1-462A-BFA8-00D61DCCD970}
{DD927BBD-0175-47BC-95DC-B3AA7B2CDBE1} = {99C564F4-BF8F-4555-AAB7-3A379C784CC4}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Xunit;
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Jellyfin.Plugin.ListenBrainz.Common\Jellyfin.Plugin.ListenBrainz.Common.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
using Jellyfin.Plugin.ListenBrainz.Common.Extensions;
using Xunit;

namespace Jellyfin.Plugin.ListenBrainz.MusicBrainzApi.Tests;
namespace Jellyfin.Plugin.ListenBrainz.Common.Tests;

public class ExtensionsTests
public class StringExtensionsTests
{
[Theory]
[InlineData("foobar", "Foobar")]
[InlineData("", "")]
[InlineData("f", "F")]
[InlineData("FOOBAR", "FOOBAR")]
public void Extensions_Capitalize(string s, string expected)
{
Assert.Equal(expected, s.Capitalize());
}

[Theory]
[InlineData("kebabCase", "kebab-case")]
[InlineData("Kebabcase", "kebabcase")]
Expand Down
19 changes: 0 additions & 19 deletions tests/Jellyfin.Plugin.ListenBrainz.Tests/ExtensionsTests.cs

This file was deleted.

0 comments on commit 9532230

Please sign in to comment.