Skip to content

Add tests for PowerShell classes inheriting from abstract .NET classes - #6752

Merged
Dongbo Wang (daxian-dbw) merged 5 commits into
PowerShell:masterfrom
rjmholt:abstract-class-inheritance-1760
Apr 30, 2018
Merged

Add tests for PowerShell classes inheriting from abstract .NET classes#6752
Dongbo Wang (daxian-dbw) merged 5 commits into
PowerShell:masterfrom
rjmholt:abstract-class-inheritance-1760

Conversation

@rjmholt

Copy link
Copy Markdown
Collaborator

PR Summary

Add some tests to check for regressions against #1760 (which magically was fixed at some point).

In particular this tests for:

  • Instantiation.
  • Property override.
  • Method override.

If there are other things we should be testing for, let me know and I will add them.

Also, if there are other easily available .NET abstract classes that we could inherit from to diversify testing (particularly with non-void abstract methods), I would like to substitute one of those for a PSHost subclass. (I just couldn't find any good candidates after searching for a while).

PR Checklist

}

It 'can subclass .NET abstract class' {
class TestHost : System.Management.Automation.Host.PSHost

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we group related tests in a Context? That way we don't need to duplicate the TestHost declaration 3 times.

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 0c3f429 into PowerShell:master Apr 30, 2018
@rjmholt
Rob Holt (rjmholt) deleted the abstract-class-inheritance-1760 branch June 22, 2018 22:55
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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.

3 participants