Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Soenneker committed Dec 23, 2024
1 parent ba11fe2 commit 6a681b6
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 8 deletions.
13 changes: 13 additions & 0 deletions test/Soenneker.Swashbuckle.SmartEnumFilter.Tests/Collection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Xunit;

namespace Soenneker.Swashbuckle.SmartEnumFilter.Tests;

/// <summary>
/// This class has no code, and is never created. Its purpose is simply
/// to be the place to apply [CollectionDefinition] and all the
/// ICollectionFixture interfaces.
/// </summary>
[CollectionDefinition("Collection")]
public class Collection : ICollectionFixture<Fixture>
{
}
28 changes: 28 additions & 0 deletions test/Soenneker.Swashbuckle.SmartEnumFilter.Tests/Fixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Serilog;
using Soenneker.Fixtures.Unit;
using Soenneker.Utils.Test;

namespace Soenneker.Swashbuckle.SmartEnumFilter.Tests;

public class Fixture : UnitFixture
{
public override System.Threading.Tasks.ValueTask InitializeAsync()
{
SetupIoC(Services);

return base.InitializeAsync();
}

private static void SetupIoC(IServiceCollection services)
{
services.AddLogging(builder =>
{
builder.AddSerilog(dispose: true);
});

IConfiguration config = TestUtil.BuildConfig();
services.AddSingleton(config);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Soenneker.Tests.FixturedUnit;
using Xunit;

namespace Soenneker.Swashbuckle.SmartEnumFilter.Tests;

[Collection("Collection")]
public class SmartEnumSchemaFilterTests : FixturedUnitTest
{
public SmartEnumSchemaFilterTests(Fixture fixture, ITestOutputHelper output) : base(fixture, output)
{
}

[Fact]
public void Default()
{

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,35 @@

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>

<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
</PropertyGroup>

<ItemGroup>
<None Remove="appsettings.json" />
</ItemGroup>

<ItemGroup>
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Soenneker.Tests.Unit" Version="3.0.534" />
<PackageReference Include="xUnit.v3" Version="1.0.0" /></ItemGroup>
<PackageReference Include="Soenneker.Utils.Test" Version="3.0.254" />
<PackageReference Include="Soenneker.Tests.FixturedUnit" Version="3.0.1410" />
<PackageReference Include="xUnit.v3" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Soenneker.Swashbuckle.SmartEnumFilter.csproj" />
<ProjectReference Include="..\..\src\Soenneker.Swashbuckle.SmartEnumFilter.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}

0 comments on commit 6a681b6

Please sign in to comment.