Skip to content

MockException reports wrong invocation list #1534

Open
@goe5mu

Description

@goe5mu

if a test is considered failed because of invocation list does not contain an invocation then exception is thrown, but when constructing the exception the list can be already changed (by a parallel thread for instance):

var invocations = mock.MutableInvocations.ToArray();

This way exception text contains something like:
Invocation of method1 was excepted but it was never invoked.
What was invoked is:
method2
method1

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions