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

Refactor ImplementedInterfaces contraption #541

Merged
merged 1 commit into from
Dec 3, 2017

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Dec 3, 2017

ImplementedInterfaces together with InternallyImplementedInterfaceCount contains three logically semi-separate sets of interface types:

  1. interface types inherited from the mocked type
  2. IMocked<T>
  3. additional interface types requested through As<TInterface>()

Combining these three into a single collection results in some rather convoluted code.

This commit pries these three things apart: (1) is turned into a InheritedInterfaces property, which is implemented using a static backing field, (2) is directly referenced where required, and (3) is turned into a AdditionalInterfaces property.

This results in simpler code and reduced memory consumption.

`ImplementedInterfaces` together with `InternallyImplementedInterface-
Count` contains three logically semi-separate sets of interface types:

 1. interface types inherited from the mocked type
 2. `IMocked<T>`
 3. additional interface types requested through `As<TInterface>()`

This commit pries these three things apart: (1) is turned into a
`InheritedInterfaces` property, which is implemented using a static
backing field, (2) is directly referenced where required, and (3) is
turned into a `AdditionalInterfaces` property.

This results in simpler code and reduced memory consumption.
@stakx stakx merged commit e9e153c into devlooped:develop Dec 3, 2017
@stakx stakx deleted the implemented-interfaces branch December 3, 2017 12:50
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