Skip to content
Merged
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
48 changes: 48 additions & 0 deletions Tests/aweXpect.Tests/Numbers/ThatNumber.IsEqualTo.WithinTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ but it was 12.5 which differs by {expectedDifference}
""");
}

[Fact]
public async Task ForDouble_WhenSubjectAndExpectedAreNaN_ShouldSucceed()
{
double subject = double.NaN;
double expected = double.NaN;

async Task Act()
=> await That(subject).IsEqualTo(expected).Within(0.1);

await That(Act).DoesNotThrow();
}

[Theory]
[AutoData]
public async Task
Expand Down Expand Up @@ -156,6 +168,18 @@ but it was 12.5 which differs by {expectedDifference}
""");
}

[Fact]
public async Task ForFloat_WhenSubjectAndExpectedAreNaN_ShouldSucceed()
{
float subject = float.NaN;
float expected = float.NaN;

async Task Act()
=> await That(subject).IsEqualTo(expected).Within(0.1F);

await That(Act).DoesNotThrow();
}

[Theory]
[AutoData]
public async Task
Expand Down Expand Up @@ -363,6 +387,18 @@ but it was 12.5 which differs by {expectedDifference}
""");
}

[Fact]
public async Task ForNullableDouble_WhenSubjectAndExpectedAreNaN_ShouldSucceed()
{
double? subject = double.NaN;
double expected = double.NaN;

async Task Act()
=> await That(subject).IsEqualTo(expected).Within(0.1);

await That(Act).DoesNotThrow();
}

[Theory]
[AutoData]
public async Task
Expand Down Expand Up @@ -406,6 +442,18 @@ but it was 12.5 which differs by {expectedDifference}
""");
}

[Fact]
public async Task ForNullableFloat_WhenSubjectAndExpectedAreNaN_ShouldSucceed()
{
float? subject = float.NaN;
float expected = float.NaN;

async Task Act()
=> await That(subject).IsEqualTo(expected).Within(0.1F);

await That(Act).DoesNotThrow();
}

[Theory]
[AutoData]
public async Task
Expand Down
Loading