Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the xunit group across 9 directories with 2 updates #153

Merged
merged 4 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.analyzers" Version="1.16.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.assert" Version="2.9.0" />
<PackageReference Include="xunit.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.0" />
<PackageReference Include="xunit.runner.console" Version="2.9.0">
<PackageReference Include="xunit.assert" Version="2.9.2" />
<PackageReference Include="xunit.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.2" />
<PackageReference Include="xunit.runner.console" Version="2.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.0" />
<PackageReference Include="xunit.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.analyzers" Version="1.16.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.assert" Version="2.9.0" />
<PackageReference Include="xunit.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.0" />
<PackageReference Include="xunit.runner.console" Version="2.9.0">
<PackageReference Include="xunit.assert" Version="2.9.2" />
<PackageReference Include="xunit.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.2" />
<PackageReference Include="xunit.runner.console" Version="2.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.0" />
<PackageReference Include="xunit.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.analyzers" Version="1.16.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.assert" Version="2.9.0" />
<PackageReference Include="xunit.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.0" />
<PackageReference Include="xunit.runner.console" Version="2.9.0">
<PackageReference Include="xunit.assert" Version="2.9.2" />
<PackageReference Include="xunit.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.2" />
<PackageReference Include="xunit.runner.console" Version="2.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.0" />
<PackageReference Include="xunit.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.core" Version="2.9.2" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace Objectivity.AutoFixture.XUnit2.Core.Tests.Attributes
{
using System;
using System.Reflection;

using FluentAssertions;

Expand All @@ -17,6 +18,18 @@
[Trait("Category", "DataAttribute")]
public class MemberAutoDataBaseAttributeTests
{
private static readonly Type MemberType = typeof(MemberAutoDataBaseAttributeTests);
private static readonly MethodInfo TestMethod = MemberType.GetMethod(nameof(MethodUnderTest), BindingFlags.Instance | BindingFlags.NonPublic);

public static TheoryData<Type, string> MemberTypeTestData { get; } = new()
{
{ MemberType, MemberType.Name },
{ typeof(string), nameof(String) },
{ null, MemberType.Name },
};

public static TheoryData<string> NullTheoryData { get; }

[AutoData]
[Theory(DisplayName = "GIVEN uninitialized fixture WHEN constructor is invoked THEN exception is thrown")]
public void GivenUninitializedFixture_WhenConstructorIsInvoked_ThenExceptionIsThrown(string memberName)
Expand All @@ -33,6 +46,46 @@ public void GivenUninitializedFixture_WhenConstructorIsInvoked_ThenExceptionIsTh
.And.ParamName.Should().Be("fixture");
}

[MemberData(nameof(MemberTypeTestData))]
[Theory(DisplayName = "GIVEN item of unexpected type WHEN Convert is invoked THEN exception is thrown")]
public void GivenItemOfUnexpectedType_WhenConvertIsInvoked_ThenExceptionIsThrown(
Type memberType,
string expectedTypeName)
{
// Arrange
var fixture = new Fixture();
var memberName = fixture.Create<string>();
var item = fixture.Create<object>();
var attribute = new MemberAutoDataBaseAttributeUnderTest(fixture, memberName) { MemberType = memberType };

// Act
Func<object[]> act = () => attribute.CallConvertDataItem(TestMethod, item);

// Assert
act.Should().Throw<ArgumentException>()
.And.Message.Should().NotBeNullOrEmpty()
.And.Contain(memberName).And.Contain(expectedTypeName);
}

[Fact(DisplayName = "GIVEN null theory data WHEN GetData is invoked THEN null is returned")]
public void GivenNullItem_WhenGetDataIsInvoked_ThenNullIsReturned()
{
// Arrange
var fixture = new Fixture();
var attribute = new MemberAutoDataBaseAttributeUnderTest(fixture, nameof(NullTheoryData));

// Act
var data = attribute.GetData(TestMethod);

// Assert
data.Should().BeNull();
}

protected void MethodUnderTest()
{
// Empty method under test
}

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
private sealed class MemberAutoDataBaseAttributeUnderTest : MemberAutoDataBaseAttribute
{
Expand All @@ -41,14 +94,16 @@ public MemberAutoDataBaseAttributeUnderTest(IFixture fixture, string memberName,
{
}

public object[] CallConvertDataItem(MethodInfo testMethod, object item) => this.ConvertDataItem(testMethod, item);

protected override IAutoFixtureInlineAttributeProvider CreateProvider()
{
throw new NotImplementedException();
}

protected override IFixture Customize(IFixture fixture)
{
throw new NotImplementedException();
return fixture;
}
}
}
Expand Down
Loading
Loading