Skip to content

Commit

Permalink
Remove AutoFixture
Browse files Browse the repository at this point in the history
  • Loading branch information
brminnick committed Dec 17, 2024
1 parent ff923c1 commit 05846be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoFixture.Xunit2" Version="4.18.1" />
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="FluentAssertions.Analyzers" Version="0.34.1" />
<PackageReference Include="Nito.AsyncEx" Version="5.1.2" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Globalization;
using AutoFixture.Xunit2;
using CommunityToolkit.Maui.Converters;
using FluentAssertions;
using Xunit;
Expand Down Expand Up @@ -202,39 +201,39 @@ public void BoolToObjectTConverterShouldNotThrowNullInputTest()
}

[Theory]
[AutoData]
public void BoolToObjectTConverterShouldReturnDefaultValue(string defaultReturnValue)
[InlineData(null)]
[InlineData("")]
[InlineData(" ")]
[InlineData("Hello World")]
public void BoolToObjectTConverterShouldReturnDefaultValue(string? defaultReturnValue)
{
var options = new Options();
options.SetShouldSuppressExceptionsInConverters(true);

#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
var converter = new BoolToObjectConverter<string>
var converter = new BoolToObjectConverter<string?>
{
DefaultConvertReturnValue = defaultReturnValue
};
var convertResult = ((ICommunityToolkitValueConverter)converter).Convert(null, typeof(object), null, null);
convertResult.Should().Be(defaultReturnValue);
#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.

options.SetShouldSuppressExceptionsInConverters(false);
}

[Theory]
[AutoData]
[InlineData(true)]
[InlineData(false)]
public void BoolToObjectTConverterShouldReturnBackDefaultValue(bool backReturnData)
{
var options = new Options();
options.SetShouldSuppressExceptionsInConverters(true);

#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
var converter = new BoolToObjectConverter<string>
var converter = new BoolToObjectConverter<bool>
{
DefaultConvertBackReturnValue = backReturnData
};
var convertBackResult = ((ICommunityToolkitValueConverter)converter).ConvertBack(null, typeof(object), null, null);
convertBackResult.Should().Be(backReturnData);
#pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.

options.SetShouldSuppressExceptionsInConverters(false);
}
Expand Down

0 comments on commit 05846be

Please sign in to comment.