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

PrivateObject and PrivateType are not available for a project targeting netcorapp2.0 #366

Open
leftler opened this issue Feb 9, 2018 · 15 comments
Labels

Comments

@leftler
Copy link

@leftler leftler commented Feb 9, 2018

Description

Currently the classes located at Microsoft.VisualStudio.QualityTools.UnitTestFramework.PrivateObject and Microsoft.VisualStudio.QualityTools.UnitTestFramework.PrivateType are only available in the /src/TestFramework/Extension.Desktop/ project, this made sense in the past because the other project types did not support the System.Reflection classes necessary to implement those two classes.

However, as of netcoreapp2.0 those projects projects have access to all the needed classes in System.Reflection. A new Extension.CoreApp project should be built, or the existing Extension.Desktop project should be moved to the new VS15 style of projects so that <targetframeworks>netcoreapp2.0;net45</targetframeworks> could be set.

Steps to reproduce

  • Create a new test project targeting netcoreapp2.0
  • Try to use the class PrivateObject

Expected behavior

PrivateObject is found and is useable

Actual behavior

PrivateObject is not available for projects referencing the assembly that was generated from Extensions.Core

@shiitake

This comment has been minimized.

Copy link

@shiitake shiitake commented Apr 12, 2018

Just wanted to chime in that this would be a great addition to the testing framework.

@leftler

This comment has been minimized.

Copy link
Author

@leftler leftler commented Apr 13, 2018

@shiitake Irony, I just came back to this question today to see if there had been any updates on it because I needed to use it again. I had not even checked my email yet to see the notification of a new comment

jackson15j added a commit to jackson15j/c_sharp_random_project_for_learning that referenced this issue Jun 28, 2018
`PrivateObject` class testing appears to be broken in .NET Core 2.0. See:

* microsoft/testfx#366
@geoffhanna

This comment has been minimized.

Copy link

@geoffhanna geoffhanna commented Sep 12, 2018

Yes. Please.

@EShafferPPG

This comment has been minimized.

Copy link

@EShafferPPG EShafferPPG commented Oct 10, 2018

This is very useful and should be accessible in netcore.

@martonx

This comment has been minimized.

Copy link

@martonx martonx commented Oct 26, 2018

Oh, my god. Today I googling a lot, before I found this issue, that it is a known bug. But known bug for more than 8 months? Please add this functionality to .Net core tests also!

@wilsonalwaris

This comment has been minimized.

Copy link

@wilsonalwaris wilsonalwaris commented Mar 28, 2019

any idea if this is ever going to happen?

@pordner

This comment has been minimized.

Copy link

@pordner pordner commented Apr 3, 2019

Any update on this?

@cravecode

This comment has been minimized.

Copy link

@cravecode cravecode commented Jun 7, 2019

bump 👍

@capinredbeard

This comment has been minimized.

Copy link

@capinredbeard capinredbeard commented Jun 19, 2019

Agreed. This would be handy. I've been beating my head against a wall trying to figure out why I couldn't use this.

@QualityRobD

This comment has been minimized.

Copy link

@QualityRobD QualityRobD commented Jul 29, 2019

It would be great to see some love for this.

@jehrenzweig

This comment has been minimized.

Copy link

@jehrenzweig jehrenzweig commented Aug 24, 2019

I'm unable to finish upgrading several existing .NET Framework projects to .NET Core 2.2 because their unit tests rely on PrivateObject and PrivateType, which are conspicuously absent from MSTest.TestFramework 1.4.0.

UPDATE: PrivateObject and PrivateType are still conspicuously absent from MSTest.TestFramework 2.0.0, which was released on September 03, 2019.

@taylor-burns

This comment has been minimized.

Copy link

@taylor-burns taylor-burns commented Aug 30, 2019

DO IT PLEASE. NEED 😆

@Mgamerz

This comment has been minimized.

Copy link

@Mgamerz Mgamerz commented Oct 2, 2019

It is little things like this that make it hard for me to recommend moving some of our other .NET framework apps over to .net core...

@ptletski

This comment has been minimized.

Copy link

@ptletski ptletski commented Oct 7, 2019

Please do this...

@kazken3

This comment has been minimized.

Copy link

@kazken3 kazken3 commented Nov 13, 2019

It took a lot of time to get here. Please... 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.