Skip to content
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
18 changes: 9 additions & 9 deletions TUnit.Assertions.Tests/SatisfiesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public async Task Async_Satisfies_On_Direct_Property()
};

await Assert.That(myModel)
.Satisfies(model => model.Value, assert => assert.IsEqualTo("Hello")!);
.SatisfiesAsync(async model => await model.Value!, assert => assert.IsEqualTo("Hello")!);
}

[Test]
Expand All @@ -69,9 +69,9 @@ public async Task Async_Satisfies_On_Nested_Property()
};

await Assert.That(myModel)
.Satisfies(model => model.Nested, assert =>
assert.Satisfies(model => model?.Nested, innerAssert =>
innerAssert.Satisfies(model => model?.Value, innerAssert2 =>
.SatisfiesAsync(async model => await model.Nested!, assert =>
assert.SatisfiesAsync(async model => await model?.Nested!, innerAssert =>
innerAssert.SatisfiesAsync(async model => await model?.Value!, innerAssert2 =>
innerAssert2.IsEqualTo("Baz")!
)
)
Expand All @@ -88,7 +88,7 @@ public async Task Satisfies_On_Direct_Property_Throws()

await Assert.That(async () =>
await Assert.That(myModel)
.Satisfies(model => model.Value, assert => assert.IsEqualTo("Blah")!)
.Satisfies(model => model.Value!, assert => assert.IsEqualTo("Blah")!)
).Throws<AssertionException>()
.WithMessageMatching("""
*to satisfy*
Expand Down Expand Up @@ -140,7 +140,7 @@ public async Task Async_Satisfies_On_Direct_Property_Throws()

await Assert.That(async () =>
await Assert.That(myModel)
.Satisfies(model => model.Value, assert => assert.IsEqualTo("Blah")!)
.SatisfiesAsync(async model => await model.Value!, assert => assert.IsEqualTo("Blah")!)
).Throws<AssertionException>()
.WithMessageMatching("""
*to satisfy*
Expand All @@ -166,9 +166,9 @@ public async Task Async_Satisfies_On_Nested_Property_Throws()

await Assert.That(async () =>
await Assert.That(myModel)
.Satisfies(model => model.Nested, assert =>
assert.Satisfies(model => model?.Nested, innerAssert =>
innerAssert.Satisfies(model => model?.Value, innerAssert2 =>
.SatisfiesAsync(async model => await model.Nested!, assert =>
assert.SatisfiesAsync(async model => await model?.Nested!, innerAssert =>
innerAssert.SatisfiesAsync(async model => await model?.Value!, innerAssert2 =>
innerAssert2.IsEqualTo("Baz")!
)
)
Expand Down
Loading
Loading