Skip to content

Add possibility to verify which methods were called #476

@vbreuss

Description

@vbreuss

Inspired by TestableIO/System.IO.Abstractions#1081:
Add an option to verify which methods were called on the MockFileSystem. This should cover the following use cases:

  • Determine if a method was called with specific parameters
  • Determine if a method was called before another method
  • Determine how often a method was called

Idea:

  • Add a Statistics property on the MockFileSystem. All external calls get registered there.
  • This property should expose a list of called methods, each with the name of the method and its parameters.
  • The calls should contain a global incremented "sort order" to determine the order in which the methods were called.

We could then write extension methods (e.g. in https://github.com/Testably/Testably.Abstractions.FluentAssertions) to verify the above scenarios.

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