Skip to content

Commit

Permalink
xunit v3
Browse files Browse the repository at this point in the history
  • Loading branch information
soenneker committed Dec 16, 2024
1 parent 71d0dcc commit efa9106
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 48 deletions.
4 changes: 2 additions & 2 deletions src/Soenneker.Utils.AutoBogus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<ItemGroup>
<PackageReference Include="Bogus" Version="35.6.1" />
<PackageReference Include="Soenneker.Extensions.FieldInfo" Version="3.0.27" />
<PackageReference Include="Soenneker.Extensions.MemberInfo" Version="3.0.23" />
<PackageReference Include="Soenneker.Reflection.Cache" Version="3.0.282" />
<PackageReference Include="Soenneker.Extensions.MemberInfo" Version="3.0.24" />
<PackageReference Include="Soenneker.Reflection.Cache" Version="3.0.287" />
<PackageReference Include="System.Collections.Immutable" Version="9.0.0" />
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions test/Soenneker.Utils.AutoBogus.Tests/AutoFakerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,14 @@ public void Generate_Action_should_be_null()
result.Should().BeNull();
}

[Fact]
public void Generate_ActionString_should_be_null()
{
AutoFaker generator = new();
var result = generator.Generate<Action<string>>();
result.Should().BeNull();
}

[Fact]
public void Generate_Func_should_be_null()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static IEnumerable<object[]> GetGenerateTestCases()
yield return [typeof(TypedDataSetWithSelfReferencingTable)];
}

[SkippableTheory]
[Theory]
[MemberData(nameof(GetGenerateTestCases))]
public void Generate_Should_Return_DataSet(Type dataSetType)
{
Expand All @@ -67,7 +67,7 @@ public void Generate_Should_Return_DataSet(Type dataSetType)

bool success = BaseDataSetGenerator.TryCreateGenerator(context, cachedType, out BaseDataSetGenerator? generator);

Skip.IfNot(success, $"couldn't create generator for {dataSetType.Name}");
// Skip.IfNot(success, $"couldn't create generator for {dataSetType.Name}");

// Act
object result = generator.Generate(context);
Expand All @@ -86,7 +86,7 @@ public void Generate_Should_Return_DataSet(Type dataSetType)
}
}

[SkippableTheory]
[Theory]
[MemberData(nameof(GetGenerateTestCases))]
public void Generate_Should_Return_DataSet_With_Specified_DataTable_Row_Counts(Type dataSetType)
{
Expand Down Expand Up @@ -120,7 +120,7 @@ public void Generate_Should_Return_DataSet_With_Specified_DataTable_Row_Counts(T

bool success = BaseDataSetGenerator.TryCreateGenerator(context, cachedType, out BaseDataSetGenerator? generator);

Skip.IfNot(success, $"couldn't create generator for {dataSetType.Name}");
//Skip.IfNot(success, $"couldn't create generator for {dataSetType.Name}");

// Act
object result = generator.Generate(context);
Expand Down Expand Up @@ -223,7 +223,7 @@ public static IEnumerable<object[]> GetGenerateTestCases()
yield return [typeof(TypedDataTable2)];
}

[SkippableTheory]
[Theory]
[MemberData(nameof(GetGenerateTestCases))]
public void Generate_Should_Return_DataTable(Type dataTableType)
{
Expand All @@ -234,7 +234,7 @@ public void Generate_Should_Return_DataTable(Type dataTableType)

bool success = BaseDataTableGenerator.TryCreateGenerator(context, cachedType, out BaseDataTableGenerator? generator);

Skip.IfNot(success, $"couldn't create generator for {dataTableType.Name}");
//Skip.IfNot(success, $"couldn't create generator for {dataTableType.Name}");

// Act
object result = generator.Generate(context);
Expand All @@ -248,7 +248,7 @@ public void Generate_Should_Return_DataTable(Type dataTableType)
dataTable.Rows.Should().NotBeEmpty();
}

[SkippableTheory]
[Theory]
[MemberData(nameof(GetGenerateTestCases))]
public void Generate_Should_Return_DataTable_With_Specified_Row_Count(Type dataTableType)
{
Expand All @@ -262,7 +262,7 @@ public void Generate_Should_Return_DataTable_With_Specified_Row_Count(Type dataT

bool success = BaseDataTableGenerator.TryCreateGenerator(context, cachedType, out BaseDataTableGenerator? generator);

Skip.IfNot(success, $"couldn't create generator for {dataTableType.Name}");
// Skip.IfNot(success, $"couldn't create generator for {dataTableType.Name}");

// Act
object result = generator.Generate(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Reports;
using Xunit.Abstractions;
using Xunit;

namespace Soenneker.Utils.AutoBogus.Tests.Benchmarking;

public abstract class BenchmarkTest
public abstract class BenchmarkTest
{
protected ManualConfig DefaultConf { get; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System.Threading.Tasks;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using Soenneker.Utils.AutoBogus.Tests.Facts;
using Soenneker.Facts.Local;
using Xunit;
using Xunit.Abstractions;

namespace Soenneker.Utils.AutoBogus.Tests.Benchmarking.Benchmarks;

Expand Down
29 changes: 0 additions & 29 deletions test/Soenneker.Utils.AutoBogus.Tests/Facts/LocalFactAttribute.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Soenneker.Utils.AutoBogus.Context;
using Soenneker.Utils.AutoBogus.Generators;
using Xunit;
using Xunit.Abstractions;

namespace Soenneker.Utils.AutoBogus.Tests.Playground;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Soenneker.Facts.Local" Version="3.0.345" />
<PackageReference Include="Soenneker.Facts.Manual" Version="3.0.120" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="Soenneker.Facts.Local" Version="3.0.347" />
<PackageReference Include="Soenneker.Facts.Manual" Version="3.0.122" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand All @@ -31,7 +30,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Xunit.SkippableFact" Version="1.5.23" />
<PackageReference Include="xunit.v3" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit efa9106

Please sign in to comment.