Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for Proceed()'ing to base implementation #5

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

DrBarnabus
Copy link
Owner

Adds support for proceeding to the base implementation of a non-abstract method in a mimicked class.

Example usage:

var mimickedClass = new Mimic<AbstractClass>();

mimickedClass.Setup(m => m.NonAbstractMethod())
    .Proceed();

mimickedClass.Setup(m => m.NonAbstractMethod())
    .Callback(() => Console.WriteLine("Still hit's callbacks!"))
    .Proceed();

Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 72.47%. Comparing base (26d73e9) to head (2e4b6ed).

Files Patch % Lines
src/Mimic/Proxy/InterfaceProxyBase.cs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   72.26%   72.47%   +0.21%     
==========================================
  Files          60       61       +1     
  Lines        1972     1991      +19     
  Branches      341      343       +2     
==========================================
+ Hits         1425     1443      +18     
- Misses        481      482       +1     
  Partials       66       66              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DrBarnabus DrBarnabus force-pushed the proceed-to-base-for-classes branch 2 times, most recently from 17427f3 to 43de65f Compare February 27, 2024 21:32
Adds support for proceeding to the base implementation of a non-abstract method in a mimicked class.

Example usage:
```cs
var mimickedClass = new Mimic<AbstractClass>();

mimickedClass.Setup(m => m.NonAbstractMethod())
    .Proceed();

mimickedClass.Setup(m => m.NonAbstractMethod())
    .Callback(() => Console.WriteLine("Still hit's callbacks!"))
    .Proceed();
```
@DrBarnabus DrBarnabus marked this pull request as ready for review February 27, 2024 21:47
@DrBarnabus DrBarnabus merged commit 8d3cc63 into main Feb 27, 2024
20 checks passed
@DrBarnabus DrBarnabus deleted the proceed-to-base-for-classes branch February 27, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant