mirror of
https://github.com/bitwarden/server.git
synced 2025-05-17 17:45:36 -05:00
Test xUnit Fix
This commit is contained in:
parent
19f9ab1d3c
commit
e0b5937d80
@ -1,6 +1,5 @@
|
||||
using System.Reflection;
|
||||
using Bit.Infrastructure.IntegrationTest.Utilities;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Xunit;
|
||||
using Xunit.Sdk;
|
||||
using Xunit.v3;
|
||||
@ -47,8 +46,7 @@ public class DatabaseDataAttribute : DataAttribute
|
||||
}
|
||||
|
||||
theory
|
||||
.WithTrait("Type", customizationContext.Database.Type.ToString())
|
||||
.WithTrait("ConnectionString", customizationContext.Database.ConnectionString ?? "(none)")
|
||||
.WithTrait("DbType", customizationContext.Database.Type.ToString())
|
||||
.WithTestDisplayName($"{testMethod.Name}[{customizationContext.Database.Name ?? customizationContext.Database.Type.ToString()}]");
|
||||
|
||||
theories[i] = theory;
|
||||
|
@ -13,8 +13,8 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" Version="8.10.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNetTestSdkVersion)" />
|
||||
<PackageReference Include="xunit.v3" Version="0.6.0-pre.7" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.49">
|
||||
<PackageReference Include="xunit.v3" Version="0.7.0-pre.19" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0-pre.54">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
@ -6,7 +6,6 @@ using Bit.Infrastructure.EntityFramework;
|
||||
using Microsoft.Extensions.Caching.Distributed;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MySqlConnector;
|
||||
|
||||
namespace Bit.Infrastructure.IntegrationTest.Utilities;
|
||||
|
||||
|
@ -20,6 +20,7 @@ public class ServiceTheoryDataRow : TheoryDataRowBase
|
||||
|
||||
protected override object?[] GetData()
|
||||
{
|
||||
Console.WriteLine($"Traits:\n{Traits.Select((k, v) => $"{k}: {string.Join(", ", v)}\n")}");
|
||||
var parameters = _testMethod.GetParameters();
|
||||
|
||||
var sp = _customizationContext.Services.BuildServiceProvider();
|
||||
@ -35,6 +36,7 @@ public class ServiceTheoryDataRow : TheoryDataRowBase
|
||||
}
|
||||
|
||||
_disposalTracker.Add(scope);
|
||||
_disposalTracker.Add(sp);
|
||||
|
||||
return objects;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user