Skip to content

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

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

Merged
merged 5 commits into from
Apr 30, 2018

Conversation

rjmholt
Copy link
Collaborator

@rjmholt rjmholt commented Apr 27, 2018

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

@@ -63,6 +63,39 @@ Describe 'Classes inheritance syntax' -Tags "CI" {
[MyComparable].GetInterface("System.IComparable") | Should -Not -BeNullOrEmpty
}

It 'can subclass .NET abstract class' {
class TestHost : System.Management.Automation.Host.PSHost
Copy link
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.

@iSazonov iSazonov self-assigned this Apr 29, 2018
@daxian-dbw daxian-dbw merged commit 0c3f429 into PowerShell:master Apr 30, 2018
@rjmholt rjmholt deleted the abstract-class-inheritance-1760 branch June 22, 2018 22:55
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