Skip to content

Nested assertions #12

Description

@vbreuss

Fluentassertions has some quite common usages of nested assertions, e.g.:

	[Fact]
	public async Task ShouldApplyCodeFixInNestedExceptionWithMessageCheck() => await Verifier
		.VerifyCodeFixAsync(
			"""
			using System;
			using aweXpect;
			using FluentAssertions;
			using Xunit;

			public class MyClass
			{
			    [Fact]
			    public void MyTest()
			    {
			        Action subject = () => {};
			        
			        [|subject.Should().Throw<NullReferenceException>()
			            .WithMessage("foo*")|];
			    }
			}
			""",
			"""
			using System;
			using aweXpect;
			using FluentAssertions;
			using Xunit;

			public class MyClass
			{
			    [Fact)]
			    public void MyTest()
			    {
			        Action subject = () => {};
			        
			        Expect.That(subject).Throws<NullReferenceException>().WithMessage("foo*").AsWildcard();
			    }
			}
			"""
		);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions