Skip to content

ClearExpectation after Given<> always returns false #1596

@eNeRGy164

Description

@eNeRGy164

Description

ClearExpectation() returns false after a successful Given<>.

Complete minimal example reproducing the issue

bool success = Execute.Assertion
    .Given(() => new object())
    .ForCondition(subject => true)
    .FailWith("but collection is <null>.")
    .Then
    .ClearExpectation();

success.Should().BeTrue();

Expected behavior:

Should return true.

Actual behavior:

Returns false

Having another Given(() => {}).ForCondition() chain after ClearExpectation will return true again.

Versions

  • 6.0 beta (source)
  • Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions